Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 315122 - Improvements in the Android NDK support UI
Summary: Improvements in the Android NDK support UI
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Sequoyah (show other bugs)
Version: unspecified   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-31 13:34 EDT by Carlos Alberto Souto Junior CLA
Modified: 2016-11-08 14:45 EST (History)
4 users (show)

See Also:


Attachments
Patch for the preferences page (29.15 KB, patch)
2010-05-31 14:27 EDT, Thiago Junqueira CLA
kpqb38: iplog+
Details | Diff
Moved the native lib preference to a project property page (deleted)
2010-05-31 14:31 EDT, Carlos Alberto Souto Junior CLA
no flags Details
NDK wizard page linking system preferences. (16.00 KB, patch)
2010-05-31 14:58 EDT, Fabricio CLA
kpqb38: iplog+
Details | Diff
Moved the native lib preference to a project property page (5.12 KB, patch)
2010-05-31 15:10 EDT, Carlos Alberto Souto Junior CLA
kpqb38: iplog+
Details | Diff
Native support UIs Update (18.25 KB, patch)
2010-06-01 14:44 EDT, Carlos Alberto Souto Junior CLA
kpqb38: iplog+
Details | Diff
Bugfixes For prefs. Pages (20.96 KB, patch)
2010-06-02 07:57 EDT, Carlos Alberto Souto Junior CLA
no flags Details | Diff
Android NDK CDT support UI and features (98.75 KB, patch)
2010-06-10 08:13 EDT, Carlos Alberto Souto Junior CLA
kpqb38: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Alberto Souto Junior CLA 2010-05-31 13:34:21 EDT
Build Identifier: 3.6

Improvements in the Android NDK support UI (e.g.: adding preference pages, new wizards) 

Reproducible: Always
Comment 1 Thiago Junqueira CLA 2010-05-31 14:27:10 EDT
Created attachment 170573 [details]
Patch for the preferences page

Moved the preferences page fomr the Android plugin to the Sequoyah CDT plugin.
Comment 2 Carlos Alberto Souto Junior CLA 2010-05-31 14:31:37 EDT
Created attachment 170575 [details]
Moved the native lib preference to a project property page
Comment 3 Carlos Alberto Souto Junior CLA 2010-05-31 14:53:13 EDT
Comment on attachment 170575 [details]
Moved the native lib preference to a project property page

>Index: src/org/eclipse/sequoyah/android/cdt/internal/build/ui/NDKPropertyPage.java
>===================================================================
>--- src/org/eclipse/sequoyah/android/cdt/internal/build/ui/NDKPropertyPage.java	(revision 0)
>+++ src/org/eclipse/sequoyah/android/cdt/internal/build/ui/NDKPropertyPage.java	(revision 0)
>@@ -0,0 +1,159 @@
>+/*
>+ * @(#)NDKPropertyPage.java
>+
>+package org.eclipse.sequoyah.android.cdt.internal.build.ui;
>+
>+import org.eclipse.core.resources.IProject;
>+import org.eclipse.core.resources.IProjectNature;
>+import org.eclipse.core.runtime.CoreException;
>+import org.eclipse.core.runtime.IAdaptable;
>+import org.eclipse.core.runtime.QualifiedName;
>+import org.eclipse.jdt.core.IJavaProject;
>+import org.eclipse.sequoyah.android.cdt.build.core.INDKService;
>+import org.eclipse.sequoyah.android.cdt.build.core.NDKUtils;
>+import org.eclipse.swt.SWT;
>+import org.eclipse.swt.layout.GridData;
>+import org.eclipse.swt.layout.GridLayout;
>+import org.eclipse.swt.widgets.Composite;
>+import org.eclipse.swt.widgets.Control;
>+import org.eclipse.swt.widgets.Label;
>+import org.eclipse.swt.widgets.Text;
>+import org.eclipse.ui.IWorkbenchPropertyPage;
>+import org.eclipse.ui.dialogs.PropertyPage;
>+
>+/**
>+ * DESCRIPTION: 
>+ * This class represents the properties page for Android NDK.
>+ * It gives the user the option to set gcc version, platform, 
>+ * source object and library paths.
>+ * */
>+public class NDKPropertyPage extends PropertyPage implements IWorkbenchPropertyPage
>+{
>+
>+    //UI fields
>+    private Text libraryTxt;
>+
>+    //selected project
>+    private IProject project = null;
>+
>+    @Override
>+    protected Control createContents(Composite parent)
>+    {
>+        IProjectNature nature = null;
>+        IAdaptable apt = getElement();
>+        //get selected project
>+        if (apt instanceof IJavaProject)
>+        {
>+            IJavaProject resource = (IJavaProject) getElement();
>+            project = resource.getProject();
>+
>+            try
>+            {
>+                nature = project.getNature("org.eclipse.cdt.core.cnature");
>+            }
>+            catch (CoreException e)
>+            {
>+                // TODO Auto-generated catch block
>+                e.printStackTrace();
>+            }
>+        }
>+
>+        Composite main = new Composite(parent, SWT.FILL);
>+        main.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
>+        main.setLayout(new GridLayout(1, false));
>+
>+        Composite auxComp = new Composite(main, SWT.FILL);
>+        auxComp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
>+        auxComp.setLayout(new GridLayout(6, true));
>+
>+        //platform fields
>+        Label libraryLabel = new Label(auxComp, SWT.FILL);
>+        libraryLabel.setText("Native Library Name");
>+        libraryTxt = new Text(auxComp, SWT.FILL | SWT.BORDER);
>+        libraryTxt.setEditable(true);
>+        libraryTxt.setText(getInitialValue(INDKService.libName));
>+        libraryTxt.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
>+        if (nature == null)
>+        {
>+            libraryTxt.setEnabled(false);
>+        }
>+        else
>+        {
>+            libraryTxt.setEnabled(true);
>+        }
>+
>+        Label dummyLabel2 = new Label(auxComp, SWT.None);
>+        dummyLabel2.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 4, 1));
>+
>+        return main;
>+    }
>+
>+    /**initialize properties values
>+     * 
>+     * @param propertyId
>+     * @return
>+     */
>+    private String getInitialValue(QualifiedName propertyId)
>+    {
>+        String returnValue = "";
>+        try
>+        {
>+            if (project.getPersistentProperty(propertyId) != null)
>+            {
>+                returnValue = project.getPersistentProperty(propertyId);
>+            }
>+        }
>+        catch (CoreException e1)
>+        {
>+            returnValue = "";
>+        }
>+        return returnValue;
>+    }
>+
>+    @Override
>+    /**called when apply button is pressed
>+     * 
>+     */
>+    public void performApply()
>+    {
>+        try
>+        {
>+            // Check if the value was changed and generate a new Android make file accordingly
>+            if ((project.getPersistentProperty(INDKService.libName) == null)
>+                    || !project.getPersistentProperty(INDKService.libName).equals(
>+                            libraryTxt.getText().trim()))
>+            {
>+                project.setPersistentProperty(INDKService.libName, libraryTxt.getText().trim());
>+                // Generate a new makefile
>+                NDKUtils.generateAndroidMakeFile(project, libraryTxt.getText().trim());
>+            }
>+        }
>+        catch (CoreException e1)
>+        {
>+
>+        }
>+    }
>+
>+    @Override
>+    /**called when ok button is pressed
>+     * 
>+     */
>+    public boolean performOk()
>+    {
>+
>+        performApply();
>+
>+        return super.performOk();
>+    }
>+}
>
>Property changes on: src/org/eclipse/sequoyah/android/cdt/internal/build/ui/NDKPropertyPage.java
>___________________________________________________________________
>Added: svn:mime-type
>   + text/plain
>
>Index: plugin.properties
>===================================================================
>--- plugin.properties	(revision 2142)
>+++ plugin.properties	(working copy)
>@@ -1,2 +1,3 @@
> pluginName=Android Native Support UI
> provider=Eclipse Sequoyah
>+NDKPropertiesPages = Android NDK
>Index: plugin.xml
>===================================================================
>--- plugin.xml	(revision 2142)
>+++ plugin.xml	(working copy)
>@@ -37,5 +37,13 @@
>          </action>
>       </objectContribution>
>    </extension>
>+   <extension
>+         point="org.eclipse.ui.propertyPages">
>+      <page
>+            class="org.eclipse.sequoyah.android.cdt.internal.build.ui.NDKPropertyPage"
>+            id="org.eclipse.sequoyah.android.cdt.build.ui.NDKPojectPropertyPage"
>+            name="%NDKPropertiesPages">
>+      </page>
>+   </extension>
> 
> </plugin>
>Index: META-INF/MANIFEST.MF
>===================================================================
>--- META-INF/MANIFEST.MF	(revision 2142)
>+++ META-INF/MANIFEST.MF	(working copy)
>@@ -15,3 +15,6 @@
>  org.eclipse.sequoyah.android.cdt.build.core;bundle-version="1.0.0"
> Bundle-RequiredExecutionEnvironment: J2SE-1.5
> Bundle-ActivationPolicy: lazy
>+Import-Package: org.eclipse.jdt.core
>+Bundle-Localization: plugin
>+
Comment 4 Fabricio CLA 2010-05-31 14:58:32 EDT
Created attachment 170581 [details]
NDK wizard page linking system preferences.
Comment 5 Carlos Alberto Souto Junior CLA 2010-05-31 14:59:26 EDT
Comment on attachment 170575 [details]
Moved the native lib preference to a project property page

>Index: src/org/eclipse/sequoyah/android/cdt/internal/build/ui/NDKPropertyPage.java
>===================================================================
>--- src/org/eclipse/sequoyah/android/cdt/internal/build/ui/NDKPropertyPage.java	(revision 0)
>+++ src/org/eclipse/sequoyah/android/cdt/internal/build/ui/NDKPropertyPage.java	(revision 0)
>@@ -0,0 +1,159 @@

>+package org.eclipse.sequoyah.android.cdt.internal.build.ui;
>+
>+import org.eclipse.core.resources.IProject;
>+import org.eclipse.core.resources.IProjectNature;
>+import org.eclipse.core.runtime.CoreException;
>+import org.eclipse.core.runtime.IAdaptable;
>+import org.eclipse.core.runtime.QualifiedName;
>+import org.eclipse.jdt.core.IJavaProject;
>+import org.eclipse.sequoyah.android.cdt.build.core.INDKService;
>+import org.eclipse.sequoyah.android.cdt.build.core.NDKUtils;
>+import org.eclipse.swt.SWT;
>+import org.eclipse.swt.layout.GridData;
>+import org.eclipse.swt.layout.GridLayout;
>+import org.eclipse.swt.widgets.Composite;
>+import org.eclipse.swt.widgets.Control;
>+import org.eclipse.swt.widgets.Label;
>+import org.eclipse.swt.widgets.Text;
>+import org.eclipse.ui.IWorkbenchPropertyPage;
>+import org.eclipse.ui.dialogs.PropertyPage;
>+
>+/**
>+ * DESCRIPTION: 
>+ * This class represents the properties page for Android NDK.
>+ * It gives the user the option to set gcc version, platform, 
>+ * source object and library paths.
>+ * */
>+public class NDKPropertyPage extends PropertyPage implements IWorkbenchPropertyPage
>+{
>+
>+    //UI fields
>+    private Text libraryTxt;
>+
>+    //selected project
>+    private IProject project = null;
>+
>+    @Override
>+    protected Control createContents(Composite parent)
>+    {
>+        IProjectNature nature = null;
>+        IAdaptable apt = getElement();
>+        //get selected project
>+        if (apt instanceof IJavaProject)
>+        {
>+            IJavaProject resource = (IJavaProject) getElement();
>+            project = resource.getProject();
>+
>+            try
>+            {
>+                nature = project.getNature("org.eclipse.cdt.core.cnature");
>+            }
>+            catch (CoreException e)
>+            {
>+                // TODO Auto-generated catch block
>+                e.printStackTrace();
>+            }
>+        }
>+
>+        Composite main = new Composite(parent, SWT.FILL);
>+        main.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
>+        main.setLayout(new GridLayout(1, false));
>+
>+        Composite auxComp = new Composite(main, SWT.FILL);
>+        auxComp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
>+        auxComp.setLayout(new GridLayout(6, true));
>+
>+        //platform fields
>+        Label libraryLabel = new Label(auxComp, SWT.FILL);
>+        libraryLabel.setText("Native Library Name");
>+        libraryTxt = new Text(auxComp, SWT.FILL | SWT.BORDER);
>+        libraryTxt.setEditable(true);
>+        libraryTxt.setText(getInitialValue(INDKService.libName));
>+        libraryTxt.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
>+        if (nature == null)
>+        {
>+            libraryTxt.setEnabled(false);
>+        }
>+        else
>+        {
>+            libraryTxt.setEnabled(true);
>+        }
>+
>+        Label dummyLabel2 = new Label(auxComp, SWT.None);
>+        dummyLabel2.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 4, 1));
>+
>+        return main;
>+    }
>+
>+    /**initialize properties values
>+     * 
>+     * @param propertyId
>+     * @return
>+     */
>+    private String getInitialValue(QualifiedName propertyId)
>+    {
>+        String returnValue = "";
>+        try
>+        {
>+            if (project.getPersistentProperty(propertyId) != null)
>+            {
>+                returnValue = project.getPersistentProperty(propertyId);
>+            }
>+        }
>+        catch (CoreException e1)
>+        {
>+            returnValue = "";
>+        }
>+        return returnValue;
>+    }
>+
>+    @Override
>+    /**called when apply button is pressed
>+     * 
>+     */
>+    public void performApply()
>+    {
>+        try
>+        {
>+            // Check if the value was changed and generate a new Android make file accordingly
>+            if ((project.getPersistentProperty(INDKService.libName) == null)
>+                    || !project.getPersistentProperty(INDKService.libName).equals(
>+                            libraryTxt.getText().trim()))
>+            {
>+                project.setPersistentProperty(INDKService.libName, libraryTxt.getText().trim());
>+                // Generate a new makefile
>+                NDKUtils.generateAndroidMakeFile(project, libraryTxt.getText().trim());
>+            }
>+        }
>+        catch (CoreException e1)
>+        {
>+
>+        }
>+    }
>+
>+    @Override
>+    /**called when ok button is pressed
>+     * 
>+     */
>+    public boolean performOk()
>+    {
>+
>+        performApply();
>+
>+        return super.performOk();
>+    }
>+}
>
>Property changes on: src/org/eclipse/sequoyah/android/cdt/internal/build/ui/NDKPropertyPage.java
>___________________________________________________________________
>Added: svn:mime-type
>   + text/plain
>
>Index: plugin.properties
>===================================================================
>--- plugin.properties	(revision 2142)
>+++ plugin.properties	(working copy)
>@@ -1,2 +1,3 @@
> pluginName=Android Native Support UI
> provider=Eclipse Sequoyah
>+NDKPropertiesPages = Android NDK
>Index: plugin.xml
>===================================================================
>--- plugin.xml	(revision 2142)
>+++ plugin.xml	(working copy)
>@@ -37,5 +37,13 @@
>          </action>
>       </objectContribution>
>    </extension>
>+   <extension
>+         point="org.eclipse.ui.propertyPages">
>+      <page
>+            class="org.eclipse.sequoyah.android.cdt.internal.build.ui.NDKPropertyPage"
>+            id="org.eclipse.sequoyah.android.cdt.build.ui.NDKPojectPropertyPage"
>+            name="%NDKPropertiesPages">
>+      </page>
>+   </extension>
> 
> </plugin>
>Index: META-INF/MANIFEST.MF
>===================================================================
>--- META-INF/MANIFEST.MF	(revision 2142)
>+++ META-INF/MANIFEST.MF	(working copy)
>@@ -15,3 +15,6 @@
>  org.eclipse.sequoyah.android.cdt.build.core;bundle-version="1.0.0"
> Bundle-RequiredExecutionEnvironment: J2SE-1.5
> Bundle-ActivationPolicy: lazy
>+Import-Package: org.eclipse.jdt.core
>+Bundle-Localization: plugin
>+
Comment 6 Carlos Alberto Souto Junior CLA 2010-05-31 15:10:49 EDT
Created attachment 170582 [details]
Moved the native lib preference to a project property page
Comment 7 Eclipse Webmaster CLA 2010-05-31 16:17:33 EDT
The content of attachment 170575 [details] has been deleted by
    Eclipse Webmaster <webmaster@eclipse.org>
who provided the following reason:

Poster request

The token used to delete this attachment was generated at 2010-05-31 16:17:06 EDT.
Comment 8 Carlos Alberto Souto Junior CLA 2010-06-01 14:44:47 EDT
Created attachment 170676 [details]
Native support UIs Update
Comment 9 Carlos Alberto Souto Junior CLA 2010-06-02 07:57:31 EDT
Created attachment 170778 [details]
Bugfixes For prefs. Pages
Comment 10 Carlos Alberto Souto Junior CLA 2010-06-10 08:13:04 EDT
Created attachment 171630 [details]
Android NDK CDT support UI and features

adds quickfix, custom wizards and prefs. pages in the Sequoyah CDT Plugin
Comment 11 Daniel Drigo Pastore CLA 2010-06-18 16:26:10 EDT
Moving the bug.
Comment 12 Daniel Drigo Pastore CLA 2010-06-18 16:27:19 EDT
Merged on trunk@2163.
Build ID 1.0.0.N20100614-0335.