Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordstadnik2006-02-24 10:38:12 +0000
committerdstadnik2006-02-24 10:38:12 +0000
commita7d7d133acaadc28f2dc49fa0de9a563d801f94d (patch)
tree34f316a40497327934f6345f0beb9786f524de6e /plugins/org.eclipse.gmf.codegen.ui
parent602092c50199e38dc309373e94a3ab92c282ba7d (diff)
downloadorg.eclipse.gmf-tooling-a7d7d133acaadc28f2dc49fa0de9a563d801f94d.tar.gz
org.eclipse.gmf-tooling-a7d7d133acaadc28f2dc49fa0de9a563d801f94d.tar.xz
org.eclipse.gmf-tooling-a7d7d133acaadc28f2dc49fa0de9a563d801f94d.zip
use icons for node/link/label checkbox columns
Diffstat (limited to 'plugins/org.eclipse.gmf.codegen.ui')
-rw-r--r--plugins/org.eclipse.gmf.codegen.ui/icons/full/checked.gif (renamed from plugins/org.eclipse.gmf.codegen.ui/icons/full/obj16/checked.gif)bin343 -> 343 bytes
-rw-r--r--plugins/org.eclipse.gmf.codegen.ui/icons/full/label.gifbin0 -> 114 bytes
-rw-r--r--plugins/org.eclipse.gmf.codegen.ui/icons/full/link.gifbin0 -> 108 bytes
-rw-r--r--plugins/org.eclipse.gmf.codegen.ui/icons/full/node.gifbin0 -> 114 bytes
-rw-r--r--plugins/org.eclipse.gmf.codegen.ui/icons/full/unchecked.gif (renamed from plugins/org.eclipse.gmf.codegen.ui/icons/full/obj16/unchecked.gif)bin148 -> 148 bytes
-rw-r--r--plugins/org.eclipse.gmf.codegen.ui/src/org/eclipse/gmf/internal/codegen/CodeGenUIPlugin.java68
-rw-r--r--plugins/org.eclipse.gmf.codegen.ui/src/org/eclipse/gmf/internal/codegen/dashboard/DashboardFigure.java2
-rw-r--r--plugins/org.eclipse.gmf.codegen.ui/src/org/eclipse/gmf/internal/codegen/dashboard/DashboardPart.java2
-rw-r--r--plugins/org.eclipse.gmf.codegen.ui/src/org/eclipse/gmf/internal/codegen/wizards/DefinitionPage.java20
9 files changed, 42 insertions, 50 deletions
diff --git a/plugins/org.eclipse.gmf.codegen.ui/icons/full/obj16/checked.gif b/plugins/org.eclipse.gmf.codegen.ui/icons/full/checked.gif
index 9cacb96dc..9cacb96dc 100644
--- a/plugins/org.eclipse.gmf.codegen.ui/icons/full/obj16/checked.gif
+++ b/plugins/org.eclipse.gmf.codegen.ui/icons/full/checked.gif
Binary files differ
diff --git a/plugins/org.eclipse.gmf.codegen.ui/icons/full/label.gif b/plugins/org.eclipse.gmf.codegen.ui/icons/full/label.gif
new file mode 100644
index 000000000..84d778cbe
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen.ui/icons/full/label.gif
Binary files differ
diff --git a/plugins/org.eclipse.gmf.codegen.ui/icons/full/link.gif b/plugins/org.eclipse.gmf.codegen.ui/icons/full/link.gif
new file mode 100644
index 000000000..e5a02a5e1
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen.ui/icons/full/link.gif
Binary files differ
diff --git a/plugins/org.eclipse.gmf.codegen.ui/icons/full/node.gif b/plugins/org.eclipse.gmf.codegen.ui/icons/full/node.gif
new file mode 100644
index 000000000..7905b47dc
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen.ui/icons/full/node.gif
Binary files differ
diff --git a/plugins/org.eclipse.gmf.codegen.ui/icons/full/obj16/unchecked.gif b/plugins/org.eclipse.gmf.codegen.ui/icons/full/unchecked.gif
index f6b9f8a59..f6b9f8a59 100644
--- a/plugins/org.eclipse.gmf.codegen.ui/icons/full/obj16/unchecked.gif
+++ b/plugins/org.eclipse.gmf.codegen.ui/icons/full/unchecked.gif
Binary files differ
diff --git a/plugins/org.eclipse.gmf.codegen.ui/src/org/eclipse/gmf/internal/codegen/CodeGenUIPlugin.java b/plugins/org.eclipse.gmf.codegen.ui/src/org/eclipse/gmf/internal/codegen/CodeGenUIPlugin.java
index 6744b9f38..39fa39c56 100644
--- a/plugins/org.eclipse.gmf.codegen.ui/src/org/eclipse/gmf/internal/codegen/CodeGenUIPlugin.java
+++ b/plugins/org.eclipse.gmf.codegen.ui/src/org/eclipse/gmf/internal/codegen/CodeGenUIPlugin.java
@@ -23,15 +23,18 @@ import org.osgi.framework.BundleContext;
public class CodeGenUIPlugin extends AbstractUIPlugin {
- public static final String GMF_LOGO = "/icons/full/logo_banner.png";
- public static final String SYNC_IMAGE = "/icons/full/synced.gif";
+ public static final String GMF_LOGO_IMAGE = "/icons/full/logo_banner.png";
+ public static final String SYNC_ICON = "/icons/full/synced.gif";
+ public static final String CHECKED_ICON = "/icons/full/checked.gif";
+ public static final String UNCHECKED_ICON = "/icons/full/unchecked.gif";
+ public static final String NODE_ICON = "/icons/full/node.gif";
+ public static final String LINK_ICON = "/icons/full/link.gif";
+ public static final String LABEL_ICON = "/icons/full/label.gif";
public static final String GDM_ICON = "/icons/full/obj16/GMFGraphModelFile.gif";
public static final String DM_ICON = "/icons/full/obj16/EcoreModelFile.gif";
public static final String TDM_ICON = "/icons/full/obj16/GMFToolModelFile.gif";
public static final String MM_ICON = "/icons/full/obj16/GMFMapModelFile.gif";
public static final String GM_ICON = "/icons/full/obj16/GMFGenModelFile.gif";
- public static final String CHECKED_ICON = "/icons/full/obj16/checked.gif";
- public static final String UNCHECKED_ICON = "/icons/full/obj16/unchecked.gif";
private static CodeGenUIPlugin plugin;
@@ -49,41 +52,28 @@ public class CodeGenUIPlugin extends AbstractUIPlugin {
}
protected void initializeImageRegistry(ImageRegistry reg) {
- ImageDescriptor id = imageDescriptorFromPlugin(getBundle().getSymbolicName(), GMF_LOGO);
- if (id != null) {
- reg.put(GMF_LOGO, id);
- }
- id = imageDescriptorFromPlugin(getBundle().getSymbolicName(), SYNC_IMAGE);
- if (id != null) {
- reg.put(SYNC_IMAGE, id);
- }
- id = imageDescriptorFromPlugin("org.eclipse.gmf.graphdef.edit", GDM_ICON);
- if (id != null) {
- reg.put(GDM_ICON, id);
- }
- id = imageDescriptorFromPlugin("org.eclipse.emf.ecore.editor", DM_ICON);
- if (id != null) {
- reg.put(DM_ICON, id);
- }
- id = imageDescriptorFromPlugin("org.eclipse.gmf.tooldef.edit", TDM_ICON);
- if (id != null) {
- reg.put(TDM_ICON, id);
- }
- id = imageDescriptorFromPlugin("org.eclipse.gmf.map.edit", MM_ICON);
- if (id != null) {
- reg.put(MM_ICON, id);
- }
- id = imageDescriptorFromPlugin("org.eclipse.gmf.codegen.edit", GM_ICON);
- if (id != null) {
- reg.put(GM_ICON, id);
- }
- id = imageDescriptorFromPlugin(getBundle().getSymbolicName(), CHECKED_ICON);
- if (id != null) {
- reg.put(CHECKED_ICON, id);
- }
- id = imageDescriptorFromPlugin(getBundle().getSymbolicName(), UNCHECKED_ICON);
- if (id != null) {
- reg.put(UNCHECKED_ICON, id);
+ loadImage(reg, GMF_LOGO_IMAGE);
+ loadImage(reg, SYNC_ICON);
+ loadImage(reg, CHECKED_ICON);
+ loadImage(reg, UNCHECKED_ICON);
+ loadImage(reg, NODE_ICON);
+ loadImage(reg, LINK_ICON);
+ loadImage(reg, LABEL_ICON);
+ loadImage(reg, GDM_ICON,"org.eclipse.gmf.graphdef.edit");
+ loadImage(reg, DM_ICON, "org.eclipse.emf.ecore.editor");
+ loadImage(reg, TDM_ICON, "org.eclipse.gmf.tooldef.edit");
+ loadImage(reg, MM_ICON, "org.eclipse.gmf.map.edit");
+ loadImage(reg, GM_ICON, "org.eclipse.gmf.codegen.edit");
+ }
+
+ protected void loadImage(ImageRegistry registry, String id) {
+ loadImage(registry, id, getBundle().getSymbolicName());
+ }
+
+ protected void loadImage(ImageRegistry registry, String id, String bundleId) {
+ ImageDescriptor descriptor = imageDescriptorFromPlugin(bundleId, id);
+ if (descriptor != null) {
+ registry.put(id, descriptor);
}
}
diff --git a/plugins/org.eclipse.gmf.codegen.ui/src/org/eclipse/gmf/internal/codegen/dashboard/DashboardFigure.java b/plugins/org.eclipse.gmf.codegen.ui/src/org/eclipse/gmf/internal/codegen/dashboard/DashboardFigure.java
index 7750dd51d..7e5a25b70 100644
--- a/plugins/org.eclipse.gmf.codegen.ui/src/org/eclipse/gmf/internal/codegen/dashboard/DashboardFigure.java
+++ b/plugins/org.eclipse.gmf.codegen.ui/src/org/eclipse/gmf/internal/codegen/dashboard/DashboardFigure.java
@@ -89,7 +89,7 @@ public class DashboardFigure extends RectangleFigure {
public DashboardFigure() {
add(logoFigure = new ImageFigure());
- Image logoImage = CodeGenUIPlugin.getDefault().getImageRegistry().get(CodeGenUIPlugin.GMF_LOGO);
+ Image logoImage = CodeGenUIPlugin.getDefault().getImageRegistry().get(CodeGenUIPlugin.GMF_LOGO_IMAGE);
if (logoImage != null) {
logoFigure.setImage(logoImage);
}
diff --git a/plugins/org.eclipse.gmf.codegen.ui/src/org/eclipse/gmf/internal/codegen/dashboard/DashboardPart.java b/plugins/org.eclipse.gmf.codegen.ui/src/org/eclipse/gmf/internal/codegen/dashboard/DashboardPart.java
index 550b78b72..ca264d92e 100644
--- a/plugins/org.eclipse.gmf.codegen.ui/src/org/eclipse/gmf/internal/codegen/dashboard/DashboardPart.java
+++ b/plugins/org.eclipse.gmf.codegen.ui/src/org/eclipse/gmf/internal/codegen/dashboard/DashboardPart.java
@@ -77,7 +77,7 @@ public class DashboardPart extends ViewPart {
IAction syncSelectionAction = new Action("Synchronize", IAction.AS_CHECK_BOX) {
};
syncSelectionAction.setToolTipText("Synchronize with workbench selection");
- ImageDescriptor synchImage = CodeGenUIPlugin.getDefault().getImageRegistry().getDescriptor(CodeGenUIPlugin.SYNC_IMAGE);
+ ImageDescriptor synchImage = CodeGenUIPlugin.getDefault().getImageRegistry().getDescriptor(CodeGenUIPlugin.SYNC_ICON);
if (synchImage != null) {
syncSelectionAction.setImageDescriptor(synchImage);
}
diff --git a/plugins/org.eclipse.gmf.codegen.ui/src/org/eclipse/gmf/internal/codegen/wizards/DefinitionPage.java b/plugins/org.eclipse.gmf.codegen.ui/src/org/eclipse/gmf/internal/codegen/wizards/DefinitionPage.java
index 708422f47..739179963 100644
--- a/plugins/org.eclipse.gmf.codegen.ui/src/org/eclipse/gmf/internal/codegen/wizards/DefinitionPage.java
+++ b/plugins/org.eclipse.gmf.codegen.ui/src/org/eclipse/gmf/internal/codegen/wizards/DefinitionPage.java
@@ -23,6 +23,7 @@ import org.eclipse.gmf.internal.codegen.resolver.ResolvedItem;
import org.eclipse.gmf.internal.codegen.resolver.StructureBuilder;
import org.eclipse.jface.viewers.CellEditor;
import org.eclipse.jface.viewers.CheckboxCellEditor;
+import org.eclipse.jface.viewers.ColumnPixelData;
import org.eclipse.jface.viewers.ColumnWeightData;
import org.eclipse.jface.viewers.ICellModifier;
import org.eclipse.jface.viewers.ILabelProvider;
@@ -99,16 +100,16 @@ public class DefinitionPage extends WizardPage {
TableLayout layout = new TableLayout();
tree.setLayout(layout);
tree.setHeaderVisible(true);
- tree.setLinesVisible(true);
+ // tree.setLinesVisible(true);
TreeColumn elementColumn = new TreeColumn(tree, SWT.LEFT);
elementColumn.setText("Element");
elementColumn.setResizable(true);
layout.addColumnData(new ColumnWeightData(5, 32, true));
- addResolutionColumn(tree, Resolution.NODE);
- addResolutionColumn(tree, Resolution.LINK);
- addResolutionColumn(tree, Resolution.LABEL);
+ addResolutionColumn(tree, Resolution.NODE, CodeGenUIPlugin.NODE_ICON);
+ addResolutionColumn(tree, Resolution.LINK, CodeGenUIPlugin.LINK_ICON);
+ addResolutionColumn(tree, Resolution.LABEL, CodeGenUIPlugin.LABEL_ICON);
final TreeViewer viewer = new TreeViewer(tree);
viewer.setContentProvider(new ResolverContentProvider());
@@ -142,11 +143,12 @@ public class DefinitionPage extends WizardPage {
return viewer;
}
- protected TreeColumn addResolutionColumn(Tree tree, Resolution resolution) {
- TreeColumn column = new TreeColumn(tree, SWT.LEFT);
- column.setText(resolution.getName());
- column.setResizable(true);
- ((TableLayout) tree.getLayout()).addColumnData(new ColumnWeightData(1, 16, true));
+ protected TreeColumn addResolutionColumn(Tree tree, Resolution resolution, String iconId) {
+ TreeColumn column = new TreeColumn(tree, SWT.CENTER);
+ // column.setText(resolution.getName());
+ column.setImage(CodeGenUIPlugin.getDefault().getImageRegistry().get(iconId));
+ column.setResizable(false);
+ ((TableLayout) tree.getLayout()).addColumnData(new ColumnPixelData(18, false, true));
return column;
}

Back to the top