diff options
| author | Benjamin Grouhan | 2015-04-27 15:21:36 +0000 |
|---|---|---|
| committer | Laurent Fasani | 2015-05-12 08:12:18 +0000 |
| commit | 2fa80f3765671d7d3b0b22cf55a2f21d98109cde (patch) | |
| tree | 649a45bb1072a4eacb2ad93b658b1c9a9dca9137 | |
| parent | 766e9850e0dfaeb7443a89cf504664506d07d4dc (diff) | |
| download | org.eclipse.sirius-2fa80f3765671d7d3b0b22cf55a2f21d98109cde.tar.gz org.eclipse.sirius-2fa80f3765671d7d3b0b22cf55a2f21d98109cde.tar.xz org.eclipse.sirius-2fa80f3765671d7d3b0b22cf55a2f21d98109cde.zip | |
[460706] Add a dialog to browse images in ImagePath property sections
Use the helper added in the previous commit to open a
WorkspaceAndPluginsResourceDialog for images in each ImagePath property
section.
Bug: 460706
Change-Id: I061d6455d03fc370c67e1c695c590ffc33177a6c
Signed-off-by: Benjamin Grouhan <benjamin.grouhan@obeo.fr>
18 files changed, 368 insertions, 109 deletions
diff --git a/plugins/org.eclipse.sirius.doc/doc/Release Notes.html b/plugins/org.eclipse.sirius.doc/doc/Release Notes.html index 1587e3d621..e17be05352 100644 --- a/plugins/org.eclipse.sirius.doc/doc/Release Notes.html +++ b/plugins/org.eclipse.sirius.doc/doc/Release Notes.html @@ -59,6 +59,7 @@ <li>A quick outline is now accessible in the VSM editor by using the shortcut «Ctrl» + «O».</li> <li>Property sections for interpreted expressions (yellow background) now have a button next to the text field to open a dialog with a bigger text area (also providing auto-completion).</li> <li>The hide label per default capability has been added to the container styles.</li> + <li>Property sections for image paths now have a button next to the text field to open a dialog browsing for images.</li> </ul> <h3 id="APIChanges">API Changes</h3> <h4 id="Changesinorg.eclipse.sirius">Changes in diff --git a/plugins/org.eclipse.sirius.doc/doc/Release Notes.textile b/plugins/org.eclipse.sirius.doc/doc/Release Notes.textile index ae747082bf..8d3edf287e 100644 --- a/plugins/org.eclipse.sirius.doc/doc/Release Notes.textile +++ b/plugins/org.eclipse.sirius.doc/doc/Release Notes.textile @@ -22,6 +22,7 @@ h3. Specifier-Visible Changes * A quick outline is now accessible in the VSM editor by using the shortcut "Ctrl" + "O". * Property sections for interpreted expressions (yellow background) now have a button next to the text field to open a dialog with a bigger text area (also providing auto-completion). * The hide label per default capability has been added to the container styles. +* Property sections for image paths now have a button next to the text field to open a dialog browsing for images. h3. API Changes diff --git a/plugins/org.eclipse.sirius.editor.diagram/src-gen/org/eclipse/sirius/diagram/editor/properties/sections/description/layer/LayerIconPropertySection.java b/plugins/org.eclipse.sirius.editor.diagram/src-gen/org/eclipse/sirius/diagram/editor/properties/sections/description/layer/LayerIconPropertySection.java index 788879ac91..bb451c0165 100644 --- a/plugins/org.eclipse.sirius.editor.diagram/src-gen/org/eclipse/sirius/diagram/editor/properties/sections/description/layer/LayerIconPropertySection.java +++ b/plugins/org.eclipse.sirius.editor.diagram/src-gen/org/eclipse/sirius/diagram/editor/properties/sections/description/layer/LayerIconPropertySection.java @@ -13,9 +13,13 @@ package org.eclipse.sirius.diagram.editor.properties.sections.description.layer; import org.eclipse.emf.ecore.EAttribute; import org.eclipse.sirius.diagram.description.DescriptionPackage; -import org.eclipse.sirius.editor.properties.sections.common.AbstractTextPropertySection; +import org.eclipse.sirius.editor.properties.sections.common.AbstractTextWithButtonPropertySection; +import org.eclipse.sirius.editor.tools.internal.presentation.WorkspaceAndPluginsResourceDialog; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.CLabel; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.layout.FormAttachment; import org.eclipse.swt.layout.FormData; import org.eclipse.swt.widgets.Composite; @@ -26,7 +30,7 @@ import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; /** * A section for the icon property of a Layer object. */ -public class LayerIconPropertySection extends AbstractTextPropertySection { +public class LayerIconPropertySection extends AbstractTextWithButtonPropertySection { /** Help control of the section. */ protected CLabel help; @@ -44,14 +48,14 @@ public class LayerIconPropertySection extends AbstractTextPropertySection { } /** - * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextPropertySection#getDefaultLabelText() + * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextWithButtonPropertySection#getDefaultLabelText() */ protected String getDefaultLabelText() { return "Icon"; //$NON-NLS-1$ } /** - * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextPropertySection#getLabelText() + * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextWithButtonPropertySection#getLabelText() */ protected String getLabelText() { String labelText; @@ -63,21 +67,21 @@ public class LayerIconPropertySection extends AbstractTextPropertySection { } /** - * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextPropertySection#getFeature() + * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextWithButtonPropertySection#getFeature() */ public EAttribute getFeature() { return DescriptionPackage.eINSTANCE.getLayer_Icon(); } /** - * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextPropertySection#getFeatureValue(String) + * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextWithButtonPropertySection#getFeatureValue(String) */ protected Object getFeatureValue(String newText) { return newText; } /** - * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextPropertySection#isEqual(String) + * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextWithButtonPropertySection#isEqual(String) */ protected boolean isEqual(String newText) { return getFeatureAsText().equals(newText); @@ -105,6 +109,19 @@ public class LayerIconPropertySection extends AbstractTextPropertySection { } + @Override + protected SelectionListener createButtonListener() { + return new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + String imagePath = WorkspaceAndPluginsResourceDialog.openDialogForImages(composite.getShell()); + if (imagePath != null) { + text.setText(imagePath); + handleTextModified(); + } + } + }; + } + /** * {@inheritDoc} */ diff --git a/plugins/org.eclipse.sirius.editor.diagram/src-gen/org/eclipse/sirius/diagram/editor/properties/sections/style/workspaceimagedescription/WorkspaceImageDescriptionWorkspacePathPropertySection.java b/plugins/org.eclipse.sirius.editor.diagram/src-gen/org/eclipse/sirius/diagram/editor/properties/sections/style/workspaceimagedescription/WorkspaceImageDescriptionWorkspacePathPropertySection.java index 61446975ea..6bd48a040a 100644 --- a/plugins/org.eclipse.sirius.editor.diagram/src-gen/org/eclipse/sirius/diagram/editor/properties/sections/style/workspaceimagedescription/WorkspaceImageDescriptionWorkspacePathPropertySection.java +++ b/plugins/org.eclipse.sirius.editor.diagram/src-gen/org/eclipse/sirius/diagram/editor/properties/sections/style/workspaceimagedescription/WorkspaceImageDescriptionWorkspacePathPropertySection.java @@ -14,9 +14,13 @@ package org.eclipse.sirius.diagram.editor.properties.sections.style.workspaceima import org.eclipse.emf.ecore.EAttribute; import org.eclipse.sirius.diagram.description.style.StylePackage; import org.eclipse.sirius.editor.editorPlugin.SiriusEditor; -import org.eclipse.sirius.editor.properties.sections.common.AbstractTextPropertySection; +import org.eclipse.sirius.editor.properties.sections.common.AbstractTextWithButtonPropertySection; +import org.eclipse.sirius.editor.tools.internal.presentation.WorkspaceAndPluginsResourceDialog; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.CLabel; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.layout.FormAttachment; import org.eclipse.swt.layout.FormData; import org.eclipse.swt.widgets.Composite; @@ -28,7 +32,7 @@ import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; * A section for the workspacePath property of a WorkspaceImageDescription * object. */ -public class WorkspaceImageDescriptionWorkspacePathPropertySection extends AbstractTextPropertySection { +public class WorkspaceImageDescriptionWorkspacePathPropertySection extends AbstractTextWithButtonPropertySection { /** Help control of the section. */ protected CLabel help; @@ -46,14 +50,14 @@ public class WorkspaceImageDescriptionWorkspacePathPropertySection extends Abstr } /** - * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextPropertySection#getDefaultLabelText() + * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextWithButtonPropertySection#getDefaultLabelText() */ protected String getDefaultLabelText() { return "WorkspacePath"; //$NON-NLS-1$ } /** - * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextPropertySection#getLabelText() + * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextWithButtonPropertySection#getLabelText() */ protected String getLabelText() { String labelText; @@ -65,21 +69,21 @@ public class WorkspaceImageDescriptionWorkspacePathPropertySection extends Abstr } /** - * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextPropertySection#getFeature() + * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextWithButtonPropertySection#getFeature() */ public EAttribute getFeature() { return StylePackage.eINSTANCE.getWorkspaceImageDescription_WorkspacePath(); } /** - * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextPropertySection#getFeatureValue(String) + * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextWithButtonPropertySection#getFeatureValue(String) */ protected Object getFeatureValue(String newText) { return newText; } /** - * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextPropertySection#isEqual(String) + * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextWithButtonPropertySection#isEqual(String) */ protected boolean isEqual(String newText) { return getFeatureAsText().equals(newText); @@ -108,6 +112,19 @@ public class WorkspaceImageDescriptionWorkspacePathPropertySection extends Abstr } + @Override + protected SelectionListener createButtonListener() { + return new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + String imagePath = WorkspaceAndPluginsResourceDialog.openDialogForImages(composite.getShell()); + if (imagePath != null) { + text.setText(imagePath); + handleTextModified(); + } + } + }; + } + /** * {@inheritDoc} */ diff --git a/plugins/org.eclipse.sirius.editor.diagram/src-gen/org/eclipse/sirius/diagram/editor/properties/sections/tool/containercreationdescription/ContainerCreationDescriptionIconPathPropertySection.java b/plugins/org.eclipse.sirius.editor.diagram/src-gen/org/eclipse/sirius/diagram/editor/properties/sections/tool/containercreationdescription/ContainerCreationDescriptionIconPathPropertySection.java index 924269f65c..7aed315557 100644 --- a/plugins/org.eclipse.sirius.editor.diagram/src-gen/org/eclipse/sirius/diagram/editor/properties/sections/tool/containercreationdescription/ContainerCreationDescriptionIconPathPropertySection.java +++ b/plugins/org.eclipse.sirius.editor.diagram/src-gen/org/eclipse/sirius/diagram/editor/properties/sections/tool/containercreationdescription/ContainerCreationDescriptionIconPathPropertySection.java @@ -13,9 +13,13 @@ package org.eclipse.sirius.diagram.editor.properties.sections.tool.containercrea import org.eclipse.emf.ecore.EAttribute; import org.eclipse.sirius.diagram.description.tool.ToolPackage; -import org.eclipse.sirius.editor.properties.sections.common.AbstractTextPropertySection; +import org.eclipse.sirius.editor.properties.sections.common.AbstractTextWithButtonPropertySection; +import org.eclipse.sirius.editor.tools.internal.presentation.WorkspaceAndPluginsResourceDialog; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.CLabel; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.layout.FormAttachment; import org.eclipse.swt.layout.FormData; import org.eclipse.swt.widgets.Composite; @@ -26,7 +30,7 @@ import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; /** * A section for the iconPath property of a ContainerCreationDescription object. */ -public class ContainerCreationDescriptionIconPathPropertySection extends AbstractTextPropertySection { +public class ContainerCreationDescriptionIconPathPropertySection extends AbstractTextWithButtonPropertySection { /** Help control of the section. */ protected CLabel help; @@ -44,14 +48,14 @@ public class ContainerCreationDescriptionIconPathPropertySection extends Abstrac } /** - * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextPropertySection#getDefaultLabelText() + * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextWithButtonPropertySection#getDefaultLabelText() */ protected String getDefaultLabelText() { return "IconPath"; //$NON-NLS-1$ } /** - * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextPropertySection#getLabelText() + * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextWithButtonPropertySection#getLabelText() */ protected String getLabelText() { String labelText; @@ -63,21 +67,21 @@ public class ContainerCreationDescriptionIconPathPropertySection extends Abstrac } /** - * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextPropertySection#getFeature() + * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextWithButtonPropertySection#getFeature() */ public EAttribute getFeature() { return ToolPackage.eINSTANCE.getContainerCreationDescription_IconPath(); } /** - * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextPropertySection#getFeatureValue(String) + * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextWithButtonPropertySection#getFeatureValue(String) */ protected Object getFeatureValue(String newText) { return newText; } /** - * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextPropertySection#isEqual(String) + * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextWithButtonPropertySection#isEqual(String) */ protected boolean isEqual(String newText) { return getFeatureAsText().equals(newText); @@ -105,6 +109,19 @@ public class ContainerCreationDescriptionIconPathPropertySection extends Abstrac } + @Override + protected SelectionListener createButtonListener() { + return new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + String imagePath = WorkspaceAndPluginsResourceDialog.openDialogForImages(composite.getShell()); + if (imagePath != null) { + text.setText(imagePath); + handleTextModified(); + } + } + }; + } + /** * {@inheritDoc} */ diff --git a/plugins/org.eclipse.sirius.editor.diagram/src-gen/org/eclipse/sirius/diagram/editor/properties/sections/tool/edgecreationdescription/EdgeCreationDescriptionIconPathPropertySection.java b/plugins/org.eclipse.sirius.editor.diagram/src-gen/org/eclipse/sirius/diagram/editor/properties/sections/tool/edgecreationdescription/EdgeCreationDescriptionIconPathPropertySection.java index 8a5650b84d..b2997a986d 100644 --- a/plugins/org.eclipse.sirius.editor.diagram/src-gen/org/eclipse/sirius/diagram/editor/properties/sections/tool/edgecreationdescription/EdgeCreationDescriptionIconPathPropertySection.java +++ b/plugins/org.eclipse.sirius.editor.diagram/src-gen/org/eclipse/sirius/diagram/editor/properties/sections/tool/edgecreationdescription/EdgeCreationDescriptionIconPathPropertySection.java @@ -13,9 +13,13 @@ package org.eclipse.sirius.diagram.editor.properties.sections.tool.edgecreationd import org.eclipse.emf.ecore.EAttribute; import org.eclipse.sirius.diagram.description.tool.ToolPackage; -import org.eclipse.sirius.editor.properties.sections.common.AbstractTextPropertySection; +import org.eclipse.sirius.editor.properties.sections.common.AbstractTextWithButtonPropertySection; +import org.eclipse.sirius.editor.tools.internal.presentation.WorkspaceAndPluginsResourceDialog; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.CLabel; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.layout.FormAttachment; import org.eclipse.swt.layout.FormData; import org.eclipse.swt.widgets.Composite; @@ -26,7 +30,7 @@ import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; /** * A section for the iconPath property of a EdgeCreationDescription object. */ -public class EdgeCreationDescriptionIconPathPropertySection extends AbstractTextPropertySection { +public class EdgeCreationDescriptionIconPathPropertySection extends AbstractTextWithButtonPropertySection { /** Help control of the section. */ protected CLabel help; @@ -44,14 +48,14 @@ public class EdgeCreationDescriptionIconPathPropertySection extends AbstractText } /** - * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextPropertySection#getDefaultLabelText() + * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextWithButtonPropertySection#getDefaultLabelText() */ protected String getDefaultLabelText() { return "IconPath"; //$NON-NLS-1$ } /** - * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextPropertySection#getLabelText() + * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextWithButtonPropertySection#getLabelText() */ protected String getLabelText() { String labelText; @@ -63,21 +67,21 @@ public class EdgeCreationDescriptionIconPathPropertySection extends AbstractText } /** - * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextPropertySection#getFeature() + * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextWithButtonPropertySection#getFeature() */ public EAttribute getFeature() { return ToolPackage.eINSTANCE.getEdgeCreationDescription_IconPath(); } /** - * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextPropertySection#getFeatureValue(String) + * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextWithButtonPropertySection#getFeatureValue(String) */ protected Object getFeatureValue(String newText) { return newText; } /** - * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextPropertySection#isEqual(String) + * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextWithButtonPropertySection#isEqual(String) */ protected boolean isEqual(String newText) { return getFeatureAsText().equals(newText); @@ -105,6 +109,19 @@ public class EdgeCreationDescriptionIconPathPropertySection extends AbstractText } + @Override + protected SelectionListener createButtonListener() { + return new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + String imagePath = WorkspaceAndPluginsResourceDialog.openDialogForImages(composite.getShell()); + if (imagePath != null) { + text.setText(imagePath); + handleTextModified(); + } + } + }; + } + /** * {@inheritDoc} */ diff --git a/plugins/org.eclipse.sirius.editor.diagram/src-gen/org/eclipse/sirius/diagram/editor/properties/sections/tool/nodecreationdescription/NodeCreationDescriptionIconPathPropertySection.java b/plugins/org.eclipse.sirius.editor.diagram/src-gen/org/eclipse/sirius/diagram/editor/properties/sections/tool/nodecreationdescription/NodeCreationDescriptionIconPathPropertySection.java index d926014381..ac0028bef0 100644 --- a/plugins/org.eclipse.sirius.editor.diagram/src-gen/org/eclipse/sirius/diagram/editor/properties/sections/tool/nodecreationdescription/NodeCreationDescriptionIconPathPropertySection.java +++ b/plugins/org.eclipse.sirius.editor.diagram/src-gen/org/eclipse/sirius/diagram/editor/properties/sections/tool/nodecreationdescription/NodeCreationDescriptionIconPathPropertySection.java @@ -13,9 +13,13 @@ package org.eclipse.sirius.diagram.editor.properties.sections.tool.nodecreationd import org.eclipse.emf.ecore.EAttribute; import org.eclipse.sirius.diagram.description.tool.ToolPackage; -import org.eclipse.sirius.editor.properties.sections.common.AbstractTextPropertySection; +import org.eclipse.sirius.editor.properties.sections.common.AbstractTextWithButtonPropertySection; +import org.eclipse.sirius.editor.tools.internal.presentation.WorkspaceAndPluginsResourceDialog; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.CLabel; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.layout.FormAttachment; import org.eclipse.swt.layout.FormData; import org.eclipse.swt.widgets.Composite; @@ -26,7 +30,7 @@ import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; /** * A section for the iconPath property of a NodeCreationDescription object. */ -public class NodeCreationDescriptionIconPathPropertySection extends AbstractTextPropertySection { +public class NodeCreationDescriptionIconPathPropertySection extends AbstractTextWithButtonPropertySection { /** Help control of the section. */ protected CLabel help; @@ -44,14 +48,14 @@ public class NodeCreationDescriptionIconPathPropertySection extends AbstractText } /** - * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextPropertySection#getDefaultLabelText() + * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextWithButtonPropertySection#getDefaultLabelText() */ protected String getDefaultLabelText() { return "IconPath"; //$NON-NLS-1$ } /** - * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextPropertySection#getLabelText() + * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextWithButtonPropertySection#getLabelText() */ protected String getLabelText() { String labelText; @@ -63,21 +67,21 @@ public class NodeCreationDescriptionIconPathPropertySection extends AbstractText } /** - * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextPropertySection#getFeature() + * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextWithButtonPropertySection#getFeature() */ public EAttribute getFeature() { return ToolPackage.eINSTANCE.getNodeCreationDescription_IconPath(); } /** - * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextPropertySection#getFeatureValue(String) + * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextWithButtonPropertySection#getFeatureValue(String) */ protected Object getFeatureValue(String newText) { return newText; } /** - * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextPropertySection#isEqual(String) + * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextWithButtonPropertySection#isEqual(String) */ protected boolean isEqual(String newText) { return getFeatureAsText().equals(newText); @@ -105,6 +109,19 @@ public class NodeCreationDescriptionIconPathPropertySection extends AbstractText } + @Override + protected SelectionListener createButtonListener() { + return new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + String imagePath = WorkspaceAndPluginsResourceDialog.openDialogForImages(composite.getShell()); + if (imagePath != null) { + text.setText(imagePath); + handleTextModified(); + } + } + }; + } + /** * {@inheritDoc} */ diff --git a/plugins/org.eclipse.sirius.editor.diagram/src-gen/org/eclipse/sirius/diagram/editor/properties/sections/tool/toolsection/ToolSectionIconPropertySection.java b/plugins/org.eclipse.sirius.editor.diagram/src-gen/org/eclipse/sirius/diagram/editor/properties/sections/tool/toolsection/ToolSectionIconPropertySection.java index 382eff2e92..d6bc0b0588 100644 --- a/plugins/org.eclipse.sirius.editor.diagram/src-gen/org/eclipse/sirius/diagram/editor/properties/sections/tool/toolsection/ToolSectionIconPropertySection.java +++ b/plugins/org.eclipse.sirius.editor.diagram/src-gen/org/eclipse/sirius/diagram/editor/properties/sections/tool/toolsection/ToolSectionIconPropertySection.java @@ -13,7 +13,11 @@ package org.eclipse.sirius.diagram.editor.properties.sections.tool.toolsection; import org.eclipse.emf.ecore.EAttribute; import org.eclipse.sirius.diagram.description.tool.ToolPackage; -import org.eclipse.sirius.editor.properties.sections.common.AbstractTextPropertySection; +import org.eclipse.sirius.editor.properties.sections.common.AbstractTextWithButtonPropertySection; +import org.eclipse.sirius.editor.tools.internal.presentation.WorkspaceAndPluginsResourceDialog; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; @@ -22,17 +26,17 @@ import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; /** * A section for the icon property of a ToolSection object. */ -public class ToolSectionIconPropertySection extends AbstractTextPropertySection { +public class ToolSectionIconPropertySection extends AbstractTextWithButtonPropertySection { /** - * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextPropertySection#getDefaultLabelText() + * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextWithButtonPropertySection#getDefaultLabelText() */ protected String getDefaultLabelText() { return "Icon"; //$NON-NLS-1$ } /** - * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextPropertySection#getLabelText() + * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextWithButtonPropertySection#getLabelText() */ protected String getLabelText() { String labelText; @@ -44,21 +48,21 @@ public class ToolSectionIconPropertySection extends AbstractTextPropertySection } /** - * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextPropertySection#getFeature() + * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextWithButtonPropertySection#getFeature() */ public EAttribute getFeature() { return ToolPackage.eINSTANCE.getToolSection_Icon(); } /** - * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextPropertySection#getFeatureValue(String) + * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextWithButtonPropertySection#getFeatureValue(String) */ protected Object getFeatureValue(String newText) { return newText; } /** - * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextPropertySection#isEqual(String) + * @see org.eclipse.sirius.diagram.editor.properties.sections.AbstractTextWithButtonPropertySection#isEqual(String) */ protected boolean isEqual(String newText) { return getFeatureAsText().equals(newText); @@ -76,6 +80,19 @@ public class ToolSectionIconPropertySection extends AbstractTextPropertySection } + @Override + protected SelectionListener createButtonListener() { + return new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + String imagePath = WorkspaceAndPluginsResourceDialog.openDialogForImages(composite.getShell()); + if (imagePath != null) { + text.setText(imagePath); + handleTextModified(); + } + } + }; + } + /** * {@inheritDoc} */ diff --git a/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/description/decorationdescription/DecorationDescriptionDecoratorPathPropertySection.java b/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/description/decorationdescription/DecorationDescriptionDecoratorPathPropertySection.java index bab22228ab..79400eaee4 100644 --- a/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/description/decorationdescription/DecorationDescriptionDecoratorPathPropertySection.java +++ b/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/description/decorationdescription/DecorationDescriptionDecoratorPathPropertySection.java @@ -13,10 +13,14 @@ package org.eclipse.sirius.editor.properties.sections.description.decorationdesc import org.eclipse.emf.ecore.EAttribute; import org.eclipse.sirius.editor.editorPlugin.SiriusEditor; -import org.eclipse.sirius.editor.properties.sections.common.AbstractTextPropertySection; +import org.eclipse.sirius.editor.properties.sections.common.AbstractTextWithButtonPropertySection; +import org.eclipse.sirius.editor.tools.internal.presentation.WorkspaceAndPluginsResourceDialog; import org.eclipse.sirius.viewpoint.description.DescriptionPackage; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.CLabel; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.layout.FormAttachment; import org.eclipse.swt.layout.FormData; import org.eclipse.swt.widgets.Composite; @@ -27,7 +31,7 @@ import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; /** * A section for the decoratorPath property of a DecorationDescription object. */ -public class DecorationDescriptionDecoratorPathPropertySection extends AbstractTextPropertySection { +public class DecorationDescriptionDecoratorPathPropertySection extends AbstractTextWithButtonPropertySection { /** Help control of the section. */ protected CLabel help; @@ -45,14 +49,14 @@ public class DecorationDescriptionDecoratorPathPropertySection extends AbstractT } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#getDefaultLabelText() + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#getDefaultLabelText() */ protected String getDefaultLabelText() { return "DecoratorPath"; //$NON-NLS-1$ } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#getLabelText() + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#getLabelText() */ protected String getLabelText() { String labelText; @@ -64,21 +68,21 @@ public class DecorationDescriptionDecoratorPathPropertySection extends AbstractT } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#getFeature() + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#getFeature() */ public EAttribute getFeature() { return DescriptionPackage.eINSTANCE.getDecorationDescription_DecoratorPath(); } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#getFeatureValue(String) + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#getFeatureValue(String) */ protected Object getFeatureValue(String newText) { return newText; } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#isEqual(String) + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#isEqual(String) */ protected boolean isEqual(String newText) { return getFeatureAsText().equals(newText); @@ -107,6 +111,19 @@ public class DecorationDescriptionDecoratorPathPropertySection extends AbstractT } + @Override + protected SelectionListener createButtonListener() { + return new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + String imagePath = WorkspaceAndPluginsResourceDialog.openDialogForImages(composite.getShell()); + if (imagePath != null) { + text.setText(imagePath); + handleTextModified(); + } + } + }; + } + /** * {@inheritDoc} */ diff --git a/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/description/viewpoint/ViewpointIconPropertySection.java b/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/description/viewpoint/ViewpointIconPropertySection.java index cc14ac50d7..ee19002961 100644 --- a/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/description/viewpoint/ViewpointIconPropertySection.java +++ b/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/description/viewpoint/ViewpointIconPropertySection.java @@ -12,8 +12,12 @@ package org.eclipse.sirius.editor.properties.sections.description.viewpoint; // Start of user code imports import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.sirius.editor.properties.sections.common.AbstractTextPropertySection; +import org.eclipse.sirius.editor.properties.sections.common.AbstractTextWithButtonPropertySection; +import org.eclipse.sirius.editor.tools.internal.presentation.WorkspaceAndPluginsResourceDialog; import org.eclipse.sirius.viewpoint.description.DescriptionPackage; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; @@ -22,17 +26,17 @@ import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; /** * A section for the icon property of a Viewpoint object. */ -public class ViewpointIconPropertySection extends AbstractTextPropertySection { +public class ViewpointIconPropertySection extends AbstractTextWithButtonPropertySection { /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#getDefaultLabelText() + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#getDefaultLabelText() */ protected String getDefaultLabelText() { return "Icon"; //$NON-NLS-1$ } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#getLabelText() + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#getLabelText() */ protected String getLabelText() { String labelText; @@ -44,21 +48,21 @@ public class ViewpointIconPropertySection extends AbstractTextPropertySection { } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#getFeature() + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#getFeature() */ public EAttribute getFeature() { return DescriptionPackage.eINSTANCE.getViewpoint_Icon(); } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#getFeatureValue(String) + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#getFeatureValue(String) */ protected Object getFeatureValue(String newText) { return newText; } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#isEqual(String) + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#isEqual(String) */ protected boolean isEqual(String newText) { return getFeatureAsText().equals(newText); @@ -76,6 +80,19 @@ public class ViewpointIconPropertySection extends AbstractTextPropertySection { } + @Override + protected SelectionListener createButtonListener() { + return new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + String imagePath = WorkspaceAndPluginsResourceDialog.openDialogForImages(composite.getShell()); + if (imagePath != null) { + text.setText(imagePath); + handleTextModified(); + } + } + }; + } + /** * {@inheritDoc} */ diff --git a/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/style/basiclabelstyledescription/BasicLabelStyleDescriptionIconPathPropertySection.java b/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/style/basiclabelstyledescription/BasicLabelStyleDescriptionIconPathPropertySection.java index edf9386940..8e9e312755 100644 --- a/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/style/basiclabelstyledescription/BasicLabelStyleDescriptionIconPathPropertySection.java +++ b/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/style/basiclabelstyledescription/BasicLabelStyleDescriptionIconPathPropertySection.java @@ -12,10 +12,14 @@ package org.eclipse.sirius.editor.properties.sections.style.basiclabelstyledescr // Start of user code imports import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.sirius.editor.properties.sections.common.AbstractTextPropertySection; +import org.eclipse.sirius.editor.properties.sections.common.AbstractTextWithButtonPropertySection; +import org.eclipse.sirius.editor.tools.internal.presentation.WorkspaceAndPluginsResourceDialog; import org.eclipse.sirius.viewpoint.description.style.StylePackage; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.CLabel; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.layout.FormAttachment; import org.eclipse.swt.layout.FormData; import org.eclipse.swt.widgets.Composite; @@ -26,7 +30,7 @@ import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; /** * A section for the iconPath property of a BasicLabelStyleDescription object. */ -public class BasicLabelStyleDescriptionIconPathPropertySection extends AbstractTextPropertySection { +public class BasicLabelStyleDescriptionIconPathPropertySection extends AbstractTextWithButtonPropertySection { /** Help control of the section. */ protected CLabel help; @@ -44,14 +48,14 @@ public class BasicLabelStyleDescriptionIconPathPropertySection extends AbstractT } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#getDefaultLabelText() + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#getDefaultLabelText() */ protected String getDefaultLabelText() { return "IconPath"; //$NON-NLS-1$ } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#getLabelText() + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#getLabelText() */ protected String getLabelText() { String labelText; @@ -63,21 +67,21 @@ public class BasicLabelStyleDescriptionIconPathPropertySection extends AbstractT } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#getFeature() + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#getFeature() */ public EAttribute getFeature() { return StylePackage.eINSTANCE.getBasicLabelStyleDescription_IconPath(); } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#getFeatureValue(String) + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#getFeatureValue(String) */ protected Object getFeatureValue(String newText) { return newText; } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#isEqual(String) + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#isEqual(String) */ protected boolean isEqual(String newText) { return getFeatureAsText().equals(newText); @@ -105,6 +109,19 @@ public class BasicLabelStyleDescriptionIconPathPropertySection extends AbstractT } + @Override + protected SelectionListener createButtonListener() { + return new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + String imagePath = WorkspaceAndPluginsResourceDialog.openDialogForImages(composite.getShell()); + if (imagePath != null) { + text.setText(imagePath); + handleTextModified(); + } + } + }; + } + /** * {@inheritDoc} */ diff --git a/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/tool/menuitemdescription/MenuItemDescriptionIconPropertySection.java b/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/tool/menuitemdescription/MenuItemDescriptionIconPropertySection.java index d5dc22a1cf..124e047ce6 100644 --- a/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/tool/menuitemdescription/MenuItemDescriptionIconPropertySection.java +++ b/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/tool/menuitemdescription/MenuItemDescriptionIconPropertySection.java @@ -12,8 +12,12 @@ package org.eclipse.sirius.editor.properties.sections.tool.menuitemdescription; // Start of user code imports import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.sirius.editor.properties.sections.common.AbstractTextPropertySection; +import org.eclipse.sirius.editor.properties.sections.common.AbstractTextWithButtonPropertySection; +import org.eclipse.sirius.editor.tools.internal.presentation.WorkspaceAndPluginsResourceDialog; import org.eclipse.sirius.viewpoint.description.tool.ToolPackage; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; @@ -22,17 +26,17 @@ import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; /** * A section for the icon property of a MenuItemDescription object. */ -public class MenuItemDescriptionIconPropertySection extends AbstractTextPropertySection { +public class MenuItemDescriptionIconPropertySection extends AbstractTextWithButtonPropertySection { /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#getDefaultLabelText() + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#getDefaultLabelText() */ protected String getDefaultLabelText() { return "Icon"; //$NON-NLS-1$ } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#getLabelText() + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#getLabelText() */ protected String getLabelText() { String labelText; @@ -44,21 +48,21 @@ public class MenuItemDescriptionIconPropertySection extends AbstractTextProperty } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#getFeature() + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#getFeature() */ public EAttribute getFeature() { return ToolPackage.eINSTANCE.getMenuItemDescription_Icon(); } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#getFeatureValue(String) + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#getFeatureValue(String) */ protected Object getFeatureValue(String newText) { return newText; } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#isEqual(String) + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#isEqual(String) */ protected boolean isEqual(String newText) { return getFeatureAsText().equals(newText); @@ -76,6 +80,19 @@ public class MenuItemDescriptionIconPropertySection extends AbstractTextProperty } + @Override + protected SelectionListener createButtonListener() { + return new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + String imagePath = WorkspaceAndPluginsResourceDialog.openDialogForImages(composite.getShell()); + if (imagePath != null) { + text.setText(imagePath); + handleTextModified(); + } + } + }; + } + /** * {@inheritDoc} */ diff --git a/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/tool/panebasedselectionwizarddescription/PaneBasedSelectionWizardDescriptionIconPathPropertySection.java b/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/tool/panebasedselectionwizarddescription/PaneBasedSelectionWizardDescriptionIconPathPropertySection.java index 8d68d8fac9..3617423b17 100644 --- a/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/tool/panebasedselectionwizarddescription/PaneBasedSelectionWizardDescriptionIconPathPropertySection.java +++ b/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/tool/panebasedselectionwizarddescription/PaneBasedSelectionWizardDescriptionIconPathPropertySection.java @@ -13,8 +13,12 @@ package org.eclipse.sirius.editor.properties.sections.tool.panebasedselectionwiz import org.eclipse.emf.ecore.EAttribute; import org.eclipse.sirius.editor.editorPlugin.SiriusEditor; -import org.eclipse.sirius.editor.properties.sections.common.AbstractTextPropertySection; +import org.eclipse.sirius.editor.properties.sections.common.AbstractTextWithButtonPropertySection; +import org.eclipse.sirius.editor.tools.internal.presentation.WorkspaceAndPluginsResourceDialog; import org.eclipse.sirius.viewpoint.description.tool.ToolPackage; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; @@ -24,17 +28,17 @@ import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; * A section for the iconPath property of a PaneBasedSelectionWizardDescription * object. */ -public class PaneBasedSelectionWizardDescriptionIconPathPropertySection extends AbstractTextPropertySection { +public class PaneBasedSelectionWizardDescriptionIconPathPropertySection extends AbstractTextWithButtonPropertySection { /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#getDefaultLabelText() + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#getDefaultLabelText() */ protected String getDefaultLabelText() { return "IconPath"; //$NON-NLS-1$ } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#getLabelText() + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#getLabelText() */ protected String getLabelText() { String labelText; @@ -46,21 +50,21 @@ public class PaneBasedSelectionWizardDescriptionIconPathPropertySection extends } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#getFeature() + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#getFeature() */ public EAttribute getFeature() { return ToolPackage.eINSTANCE.getPaneBasedSelectionWizardDescription_IconPath(); } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#getFeatureValue(String) + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#getFeatureValue(String) */ protected Object getFeatureValue(String newText) { return newText; } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#isEqual(String) + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#isEqual(String) */ protected boolean isEqual(String newText) { return getFeatureAsText().equals(newText); @@ -80,6 +84,19 @@ public class PaneBasedSelectionWizardDescriptionIconPathPropertySection extends } + @Override + protected SelectionListener createButtonListener() { + return new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + String imagePath = WorkspaceAndPluginsResourceDialog.openDialogForImages(composite.getShell()); + if (imagePath != null) { + text.setText(imagePath); + handleTextModified(); + } + } + }; + } + /** * {@inheritDoc} */ diff --git a/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/tool/panebasedselectionwizarddescription/PaneBasedSelectionWizardDescriptionWindowImagePathPropertySection.java b/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/tool/panebasedselectionwizarddescription/PaneBasedSelectionWizardDescriptionWindowImagePathPropertySection.java index 78e1484e6e..271d46d733 100644 --- a/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/tool/panebasedselectionwizarddescription/PaneBasedSelectionWizardDescriptionWindowImagePathPropertySection.java +++ b/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/tool/panebasedselectionwizarddescription/PaneBasedSelectionWizardDescriptionWindowImagePathPropertySection.java @@ -12,8 +12,12 @@ package org.eclipse.sirius.editor.properties.sections.tool.panebasedselectionwiz // Start of user code imports import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.sirius.editor.properties.sections.common.AbstractTextPropertySection; +import org.eclipse.sirius.editor.properties.sections.common.AbstractTextWithButtonPropertySection; +import org.eclipse.sirius.editor.tools.internal.presentation.WorkspaceAndPluginsResourceDialog; import org.eclipse.sirius.viewpoint.description.tool.ToolPackage; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; @@ -23,17 +27,17 @@ import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; * A section for the windowImagePath property of a * PaneBasedSelectionWizardDescription object. */ -public class PaneBasedSelectionWizardDescriptionWindowImagePathPropertySection extends AbstractTextPropertySection { +public class PaneBasedSelectionWizardDescriptionWindowImagePathPropertySection extends AbstractTextWithButtonPropertySection { /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#getDefaultLabelText() + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#getDefaultLabelText() */ protected String getDefaultLabelText() { return "WindowImagePath"; //$NON-NLS-1$ } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#getLabelText() + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#getLabelText() */ protected String getLabelText() { String labelText; @@ -45,21 +49,21 @@ public class PaneBasedSelectionWizardDescriptionWindowImagePathPropertySection e } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#getFeature() + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#getFeature() */ public EAttribute getFeature() { return ToolPackage.eINSTANCE.getPaneBasedSelectionWizardDescription_WindowImagePath(); } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#getFeatureValue(String) + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#getFeatureValue(String) */ protected Object getFeatureValue(String newText) { return newText; } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#isEqual(String) + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#isEqual(String) */ protected boolean isEqual(String newText) { return getFeatureAsText().equals(newText); @@ -77,6 +81,19 @@ public class PaneBasedSelectionWizardDescriptionWindowImagePathPropertySection e } + @Override + protected SelectionListener createButtonListener() { + return new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + String imagePath = WorkspaceAndPluginsResourceDialog.openDialogForImages(composite.getShell()); + if (imagePath != null) { + text.setText(imagePath); + handleTextModified(); + } + } + }; + } + /** * {@inheritDoc} */ diff --git a/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/tool/selectionwizarddescription/SelectionWizardDescriptionIconPathPropertySection.java b/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/tool/selectionwizarddescription/SelectionWizardDescriptionIconPathPropertySection.java index 649bbf1c09..6ba3174cd1 100644 --- a/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/tool/selectionwizarddescription/SelectionWizardDescriptionIconPathPropertySection.java +++ b/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/tool/selectionwizarddescription/SelectionWizardDescriptionIconPathPropertySection.java @@ -13,10 +13,14 @@ package org.eclipse.sirius.editor.properties.sections.tool.selectionwizarddescri import org.eclipse.emf.ecore.EAttribute; import org.eclipse.sirius.editor.editorPlugin.SiriusEditor; -import org.eclipse.sirius.editor.properties.sections.common.AbstractTextPropertySection; +import org.eclipse.sirius.editor.properties.sections.common.AbstractTextWithButtonPropertySection; +import org.eclipse.sirius.editor.tools.internal.presentation.WorkspaceAndPluginsResourceDialog; import org.eclipse.sirius.viewpoint.description.tool.ToolPackage; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.CLabel; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.layout.FormAttachment; import org.eclipse.swt.layout.FormData; import org.eclipse.swt.widgets.Composite; @@ -27,7 +31,7 @@ import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; /** * A section for the iconPath property of a SelectionWizardDescription object. */ -public class SelectionWizardDescriptionIconPathPropertySection extends AbstractTextPropertySection { +public class SelectionWizardDescriptionIconPathPropertySection extends AbstractTextWithButtonPropertySection { /** Help control of the section. */ protected CLabel help; @@ -45,14 +49,14 @@ public class SelectionWizardDescriptionIconPathPropertySection extends AbstractT } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#getDefaultLabelText() + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#getDefaultLabelText() */ protected String getDefaultLabelText() { return "IconPath"; //$NON-NLS-1$ } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#getLabelText() + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#getLabelText() */ protected String getLabelText() { String labelText; @@ -64,21 +68,21 @@ public class SelectionWizardDescriptionIconPathPropertySection extends AbstractT } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#getFeature() + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#getFeature() */ public EAttribute getFeature() { return ToolPackage.eINSTANCE.getSelectionWizardDescription_IconPath(); } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#getFeatureValue(String) + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#getFeatureValue(String) */ protected Object getFeatureValue(String newText) { return newText; } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#isEqual(String) + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#isEqual(String) */ protected boolean isEqual(String newText) { return getFeatureAsText().equals(newText); @@ -107,6 +111,19 @@ public class SelectionWizardDescriptionIconPathPropertySection extends AbstractT } + @Override + protected SelectionListener createButtonListener() { + return new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + String imagePath = WorkspaceAndPluginsResourceDialog.openDialogForImages(composite.getShell()); + if (imagePath != null) { + text.setText(imagePath); + handleTextModified(); + } + } + }; + } + /** * {@inheritDoc} */ diff --git a/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/tool/selectionwizarddescription/SelectionWizardDescriptionWindowImagePathPropertySection.java b/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/tool/selectionwizarddescription/SelectionWizardDescriptionWindowImagePathPropertySection.java index bb5ad18364..32b3a63c68 100644 --- a/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/tool/selectionwizarddescription/SelectionWizardDescriptionWindowImagePathPropertySection.java +++ b/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/tool/selectionwizarddescription/SelectionWizardDescriptionWindowImagePathPropertySection.java @@ -12,10 +12,14 @@ package org.eclipse.sirius.editor.properties.sections.tool.selectionwizarddescri // Start of user code imports import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.sirius.editor.properties.sections.common.AbstractTextPropertySection; +import org.eclipse.sirius.editor.properties.sections.common.AbstractTextWithButtonPropertySection; +import org.eclipse.sirius.editor.tools.internal.presentation.WorkspaceAndPluginsResourceDialog; import org.eclipse.sirius.viewpoint.description.tool.ToolPackage; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.CLabel; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.layout.FormAttachment; import org.eclipse.swt.layout.FormData; import org.eclipse.swt.widgets.Composite; @@ -27,7 +31,7 @@ import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; * A section for the windowImagePath property of a SelectionWizardDescription * object. */ -public class SelectionWizardDescriptionWindowImagePathPropertySection extends AbstractTextPropertySection { +public class SelectionWizardDescriptionWindowImagePathPropertySection extends AbstractTextWithButtonPropertySection { /** Help control of the section. */ protected CLabel help; @@ -45,14 +49,14 @@ public class SelectionWizardDescriptionWindowImagePathPropertySection extends Ab } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#getDefaultLabelText() + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#getDefaultLabelText() */ protected String getDefaultLabelText() { return "WindowImagePath"; //$NON-NLS-1$ } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#getLabelText() + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#getLabelText() */ protected String getLabelText() { String labelText; @@ -64,21 +68,21 @@ public class SelectionWizardDescriptionWindowImagePathPropertySection extends Ab } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#getFeature() + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#getFeature() */ public EAttribute getFeature() { return ToolPackage.eINSTANCE.getSelectionWizardDescription_WindowImagePath(); } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#getFeatureValue(String) + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#getFeatureValue(String) */ protected Object getFeatureValue(String newText) { return newText; } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#isEqual(String) + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#isEqual(String) */ protected boolean isEqual(String newText) { return getFeatureAsText().equals(newText); @@ -106,6 +110,19 @@ public class SelectionWizardDescriptionWindowImagePathPropertySection extends Ab } + @Override + protected SelectionListener createButtonListener() { + return new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + String imagePath = WorkspaceAndPluginsResourceDialog.openDialogForImages(composite.getShell()); + if (imagePath != null) { + text.setText(imagePath); + handleTextModified(); + } + } + }; + } + /** * {@inheritDoc} */ diff --git a/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/tool/tooldescription/ToolDescriptionIconPathPropertySection.java b/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/tool/tooldescription/ToolDescriptionIconPathPropertySection.java index 3a204f92b7..d6777fb1eb 100644 --- a/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/tool/tooldescription/ToolDescriptionIconPathPropertySection.java +++ b/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/tool/tooldescription/ToolDescriptionIconPathPropertySection.java @@ -12,8 +12,12 @@ package org.eclipse.sirius.editor.properties.sections.tool.tooldescription; // Start of user code imports import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.sirius.editor.properties.sections.common.AbstractTextPropertySection; +import org.eclipse.sirius.editor.properties.sections.common.AbstractTextWithButtonPropertySection; +import org.eclipse.sirius.editor.tools.internal.presentation.WorkspaceAndPluginsResourceDialog; import org.eclipse.sirius.viewpoint.description.tool.ToolPackage; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; @@ -22,17 +26,17 @@ import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; /** * A section for the iconPath property of a ToolDescription object. */ -public class ToolDescriptionIconPathPropertySection extends AbstractTextPropertySection { +public class ToolDescriptionIconPathPropertySection extends AbstractTextWithButtonPropertySection { /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#getDefaultLabelText() + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#getDefaultLabelText() */ protected String getDefaultLabelText() { return "IconPath"; //$NON-NLS-1$ } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#getLabelText() + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#getLabelText() */ protected String getLabelText() { String labelText; @@ -44,21 +48,21 @@ public class ToolDescriptionIconPathPropertySection extends AbstractTextProperty } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#getFeature() + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#getFeature() */ public EAttribute getFeature() { return ToolPackage.eINSTANCE.getToolDescription_IconPath(); } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#getFeatureValue(String) + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#getFeatureValue(String) */ protected Object getFeatureValue(String newText) { return newText; } /** - * @see org.eclipse.sirius.editor.properties.sections.AbstractTextPropertySection#isEqual(String) + * @see org.eclipse.sirius.editor.properties.sections.AbstractTextWithButtonPropertySection#isEqual(String) */ protected boolean isEqual(String newText) { return getFeatureAsText().equals(newText); @@ -76,6 +80,19 @@ public class ToolDescriptionIconPathPropertySection extends AbstractTextProperty } + @Override + protected SelectionListener createButtonListener() { + return new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + String imagePath = WorkspaceAndPluginsResourceDialog.openDialogForImages(composite.getShell()); + if (imagePath != null) { + text.setText(imagePath); + handleTextModified(); + } + } + }; + } + /** * {@inheritDoc} */ diff --git a/plugins/org.eclipse.sirius.editor/src/org/eclipse/sirius/editor/tools/internal/presentation/WorkspaceAndPluginsResourceDialog.java b/plugins/org.eclipse.sirius.editor/src/org/eclipse/sirius/editor/tools/internal/presentation/WorkspaceAndPluginsResourceDialog.java index edade87ff5..239949a26d 100644 --- a/plugins/org.eclipse.sirius.editor/src/org/eclipse/sirius/editor/tools/internal/presentation/WorkspaceAndPluginsResourceDialog.java +++ b/plugins/org.eclipse.sirius.editor/src/org/eclipse/sirius/editor/tools/internal/presentation/WorkspaceAndPluginsResourceDialog.java @@ -8,7 +8,7 @@ * Contributors: * Obeo - initial API and implementation *******************************************************************************/ -package org.eclipse.sirius.common.ui.tools.api.resource; +package org.eclipse.sirius.editor.tools.internal.presentation; import java.io.File; import java.io.IOException; @@ -248,9 +248,11 @@ public class WorkspaceAndPluginsResourceDialog extends ElementTreeSelectionDialo // the workspace root ITargetPlatformService service = (ITargetPlatformService) PlatformUI.getWorkbench().getService(ITargetPlatformService.class); ITargetDefinition td = null; - try { - td = service.getWorkspaceTargetHandle().getTargetDefinition(); - } catch (CoreException e) { + if (service != null) { + try { + td = service.getWorkspaceTargetHandle().getTargetDefinition(); + } catch (CoreException e) { + } } if (td != null) { WorkbenchProxyObject wpoTargetDefinition = new WorkbenchProxyObject(td, null); |
