Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 117506 Details for
Bug 253635
[ds tooling] Service Component wizard improvements
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
Wizard patch updates
org.eclipse.pde.ds.ui.173.patch (text/plain), 9.86 KB, created by
Rafael Oliveira Nóbrega
on 2008-11-10 19:57:17 EST
(
hide
)
Description:
Wizard patch updates
Filename:
MIME Type:
Creator:
Rafael Oliveira Nóbrega
Created:
2008-11-10 19:57:17 EST
Size:
9.86 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.ds.ui >Index: src/org/eclipse/pde/internal/ds/ui/wizards/DSNewWizard.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ds.ui/src/org/eclipse/pde/internal/ds/ui/wizards/DSNewWizard.java,v >retrieving revision 1.6 >diff -u -r1.6 DSNewWizard.java >--- src/org/eclipse/pde/internal/ds/ui/wizards/DSNewWizard.java 3 Sep 2008 23:30:37 -0000 1.6 >+++ src/org/eclipse/pde/internal/ds/ui/wizards/DSNewWizard.java 11 Nov 2008 00:56:21 -0000 >@@ -18,6 +18,7 @@ > import org.eclipse.jface.viewers.IStructuredSelection; > import org.eclipse.jface.wizard.Wizard; > import org.eclipse.pde.internal.ds.ui.Activator; >+import org.eclipse.pde.internal.ds.ui.Messages; > import org.eclipse.ui.INewWizard; > import org.eclipse.ui.IWorkbench; > >@@ -38,6 +39,7 @@ > } > > public void init(IWorkbench workbench, IStructuredSelection currentSelection) { >+ setWindowTitle(Messages.DSNewWizard_title); > fMainPage = new DSFileWizardPage(currentSelection); > } > >Index: src/org/eclipse/pde/internal/ds/ui/wizards/DSFileWizardPage.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ds.ui/src/org/eclipse/pde/internal/ds/ui/wizards/DSFileWizardPage.java,v >retrieving revision 1.9 >diff -u -r1.9 DSFileWizardPage.java >--- src/org/eclipse/pde/internal/ds/ui/wizards/DSFileWizardPage.java 5 Nov 2008 20:29:59 -0000 1.9 >+++ src/org/eclipse/pde/internal/ds/ui/wizards/DSFileWizardPage.java 11 Nov 2008 00:56:21 -0000 >@@ -18,7 +18,10 @@ > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.Status; >+import org.eclipse.jdt.core.IJavaElement; >+import org.eclipse.jdt.core.IJavaProject; > import org.eclipse.jdt.core.IType; >+import org.eclipse.jdt.core.JavaCore; > import org.eclipse.jdt.core.search.SearchEngine; > import org.eclipse.jdt.internal.core.JavaElement; > import org.eclipse.jdt.internal.ui.packageview.ClassPathContainer; >@@ -26,10 +29,12 @@ > import org.eclipse.jdt.ui.JavaUI; > import org.eclipse.jface.viewers.IStructuredSelection; > import org.eclipse.jface.window.Window; >+import org.eclipse.jface.wizard.WizardDialog; > import org.eclipse.pde.internal.core.bundle.WorkspaceBundlePluginModel; > import org.eclipse.pde.internal.core.natures.PDE; > import org.eclipse.pde.internal.ds.ui.Activator; > import org.eclipse.pde.internal.ds.ui.Messages; >+import org.eclipse.pde.internal.ds.ui.SWTUtil; > import org.eclipse.pde.internal.ui.util.PDEModelUtility; > import org.eclipse.swt.SWT; > import org.eclipse.swt.events.ModifyEvent; >@@ -40,12 +45,17 @@ > import org.eclipse.swt.layout.GridLayout; > import org.eclipse.swt.widgets.Button; > import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Display; > import org.eclipse.swt.widgets.Group; > import org.eclipse.swt.widgets.Label; > import org.eclipse.swt.widgets.Text; >+import org.eclipse.ui.PartInitException; > import org.eclipse.ui.PlatformUI; > import org.eclipse.ui.dialogs.SelectionDialog; > import org.eclipse.ui.dialogs.WizardNewFileCreationPage; >+import org.eclipse.ui.forms.events.HyperlinkEvent; >+import org.eclipse.ui.forms.events.IHyperlinkListener; >+import org.eclipse.ui.forms.widgets.Hyperlink; > import org.osgi.framework.Constants; > > public class DSFileWizardPage extends WizardNewFileCreationPage { >@@ -62,7 +72,7 @@ > private Label fDSComponentNameLabel; > > private Text fDSImplementationClassText; >- private Label fDSImplementationClassLabel; >+ private Hyperlink fDSImplementationClassHyperlink; > private Button fDSImplementationClassButton; > > private IStructuredSelection fSelection; >@@ -89,21 +99,25 @@ > private void setComponentName() { > Object element = fSelection.getFirstElement(); > if (element != null) { >- IProject project = null; >- if (element instanceof IResource) { >- project = ((IResource) element).getProject(); >- } else if (element instanceof JavaElement) { >- project = ((JavaElement) element).getJavaProject() >- .getProject(); >- } else if (element instanceof ClassPathContainer) { >- project = ((ClassPathContainer) element).getJavaProject() >- .getProject(); >- } >+ IProject project = getProject(element); > if (project != null) > setComponentNameText(project); > } > } > >+ private IProject getProject(Object element) { >+ IProject project = null; >+ if (element instanceof IResource) { >+ project = ((IResource) element).getProject(); >+ } else if (element instanceof JavaElement) { >+ project = ((JavaElement) element).getJavaProject().getProject(); >+ } else if (element instanceof ClassPathContainer) { >+ project = ((ClassPathContainer) element).getJavaProject() >+ .getProject(); >+ } >+ return project; >+ } >+ > private void setComponentNameText(IProject project) { > try { > if (project.hasNature(PDE.PLUGIN_NATURE)) { >@@ -119,6 +133,7 @@ > } > > protected void createAdvancedControls(Composite parent) { >+ > // Controls Group > fGroup = new Group(parent, SWT.NONE); > fGroup.setText(Messages.DSFileWizardPage_group); >@@ -142,10 +157,74 @@ > }); > setComponentName(); > >- // Implementation Class Label >- fDSImplementationClassLabel = new Label(fGroup, SWT.NONE); >- fDSImplementationClassLabel >+ fDSImplementationClassHyperlink = new Hyperlink(fGroup, SWT.NONE); >+ fDSImplementationClassHyperlink > .setText(Messages.DSFileWizardPage_implementation_class); >+ fDSImplementationClassHyperlink.setUnderlined(true); >+ fDSImplementationClassHyperlink.setForeground(Display.getDefault() >+ .getSystemColor(SWT.COLOR_BLUE)); >+ fDSImplementationClassHyperlink >+ .addHyperlinkListener(new IHyperlinkListener() { >+ >+ public void linkActivated(HyperlinkEvent e) { >+ String value = fDSImplementationClassText.getText(); >+ value = handleLinkActivated(value, false); >+ if (value != null) >+ fDSImplementationClassText.setText(value); >+ >+ } >+ >+ private String handleLinkActivated(String value, >+ boolean isInter) { >+ Object object = fSelection.getFirstElement(); >+ if (object != null) { >+ IProject project = getProject(object); >+ try { >+ if (project != null >+ && project >+ .hasNature(JavaCore.NATURE_ID)) { >+ IJavaProject javaProject = JavaCore >+ .create(project); >+ IJavaElement element = javaProject >+ .findType(value.replace('$', '.')); >+ if (element != null) >+ JavaUI.openInEditor(element); >+ else { >+ // TODO create our own wizard for reuse >+ // here >+ DSNewClassCreationWizard wizard = new DSNewClassCreationWizard( >+ project, isInter, value); >+ WizardDialog dialog = new WizardDialog( >+ Activator >+ .getActiveWorkbenchShell(), >+ wizard); >+ dialog.create(); >+ SWTUtil.setDialogSize(dialog, 400, 500); >+ if (dialog.open() == Window.OK) { >+ return wizard.getQualifiedName(); >+ } >+ } >+ } >+ } catch (PartInitException e1) { >+ } catch (CoreException e1) { >+ } >+ } >+ return null; >+ } >+ >+ public void linkEntered(HyperlinkEvent e) { >+ fDSImplementationClassHyperlink.setForeground(Display >+ .getDefault().getSystemColor( >+ SWT.COLOR_DARK_BLUE)); >+ } >+ >+ public void linkExited(HyperlinkEvent e) { >+ fDSImplementationClassHyperlink.setForeground(Display >+ .getDefault().getSystemColor(SWT.COLOR_BLUE)); >+ >+ } >+ >+ }); > > // Implementation Class Text > fDSImplementationClassText = new Text(fGroup, SWT.SINGLE | SWT.BORDER); >@@ -167,12 +246,10 @@ > > public void mouseDoubleClick(MouseEvent e) { > // TODO Auto-generated method stub >- > } > > public void mouseDown(MouseEvent e) { > // TODO Auto-generated method stub >- > } > > public void mouseUp(MouseEvent e) { >@@ -197,8 +274,8 @@ > } catch (CoreException e) { > } > } >- > }); >+ > } > > public String getDSComponentNameValue() { >Index: src/org/eclipse/pde/internal/ds/ui/Messages.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ds.ui/src/org/eclipse/pde/internal/ds/ui/Messages.java,v >retrieving revision 1.24 >diff -u -r1.24 Messages.java >--- src/org/eclipse/pde/internal/ds/ui/Messages.java 3 Nov 2008 21:37:09 -0000 1.24 >+++ src/org/eclipse/pde/internal/ds/ui/Messages.java 11 Nov 2008 00:56:21 -0000 >@@ -41,6 +41,8 @@ > public static String DSFileWizardPage_selectType; > public static String DSFileWizardPage_not_OSGI_folder; > >+ public static String DSNewWizard_title; >+ > public static String DSImplementationDetails_title; > public static String DSImplementationDetails_description; > public static String DSImplementationDetails_classEntry; >@@ -162,6 +164,7 @@ > public static String DSServiceComponentSection_enabledButtonMessage; > > public static String DSService_title; >+ > > > >Index: src/org/eclipse/pde/internal/ds/ui/messages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ds.ui/src/org/eclipse/pde/internal/ds/ui/messages.properties,v >retrieving revision 1.37 >diff -u -r1.37 messages.properties >--- src/org/eclipse/pde/internal/ds/ui/messages.properties 3 Nov 2008 21:37:09 -0000 1.37 >+++ src/org/eclipse/pde/internal/ds/ui/messages.properties 11 Nov 2008 00:56:21 -0000 >@@ -35,6 +35,8 @@ > DSFileWizardPage_selectType= Select Type > DSFileWizardPage_not_OSGI_folder=By convention, component files should be located in OSGI-INF/ folder > >+DSNewWizard_title=Component Definition >+ > DSImplementationDetails_title=Definition > DSImplementationDetails_description=Specify the service's implementation class: > DSImplementationDetails_classEntry=Class*:
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
caniszczyk
:
iplog+
Actions:
View
Attachments on
bug 253635
:
117134
| 117506