Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2012-08-31 17:14:17 +0000
committerEike Stepper2012-08-31 17:14:17 +0000
commitf26297db7c686bff5195197358ec5bd6c058b32d (patch)
tree6ef8ed422146a9cb68301b510a0ced6ef4e53123 /plugins
parent8b48ab2f138f0d36b5e3959c396a458877081a6a (diff)
downloadcdo-f26297db7c686bff5195197358ec5bd6c058b32d.tar.gz
cdo-f26297db7c686bff5195197358ec5bd6c058b32d.tar.xz
cdo-f26297db7c686bff5195197358ec5bd6c058b32d.zip
[388567] [UI] Support CDOTextResource and CDOBinaryResource in the generic UI
https://bugs.eclipse.org/bugs/show_bug.cgi?id=388567
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/icons/full/elcl16/NewCDOBinaryResource.gifbin0 -> 370 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/icons/full/elcl16/NewCDOResource.gifbin973 -> 373 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/icons/full/elcl16/NewCDOResourceFolder.gifbin970 -> 585 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/icons/full/elcl16/NewCDOTextResource.gifbin0 -> 366 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/icons/full/obj16/CDOBinaryResource.gifbin0 -> 350 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/icons/full/obj16/CDOFileResource.gifbin0 -> 338 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/icons/full/obj16/CDOResource.gifbin345 -> 354 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/icons/full/obj16/CDOResourceFolder.gifbin342 -> 356 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/icons/full/obj16/CDOTextResource.gifbin0 -> 345 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/plugin.properties4
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/plugin.xml24
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/NewBinaryResourceActionDelegate.java33
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/NewTextResourceActionDelegate.java33
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/messages/messages.properties2
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.shared/META-INF/MANIFEST.MF6
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.shared/icons/full/etool16/NewCDOBinaryResource.gifbin0 -> 370 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.shared/icons/full/etool16/NewCDOResource.gifbin0 -> 373 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.shared/icons/full/etool16/NewCDOResourceFolder.gifbin0 -> 585 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.shared/icons/full/etool16/NewCDOTextResource.gifbin0 -> 366 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.shared/src/org/eclipse/emf/cdo/ui/shared/SharedIcons.java30
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/META-INF/MANIFEST.MF28
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/CreateResourceNodeAction.java111
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenFileEditorAction.java43
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/messages/messages.properties18
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOSessionsView.java120
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/CDOItemProvider.java47
26 files changed, 444 insertions, 55 deletions
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/icons/full/elcl16/NewCDOBinaryResource.gif b/plugins/org.eclipse.emf.cdo.ui.ide/icons/full/elcl16/NewCDOBinaryResource.gif
new file mode 100644
index 0000000000..0b47c128eb
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/icons/full/elcl16/NewCDOBinaryResource.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/icons/full/elcl16/NewCDOResource.gif b/plugins/org.eclipse.emf.cdo.ui.ide/icons/full/elcl16/NewCDOResource.gif
index 6bcbef8bc3..094452ca19 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/icons/full/elcl16/NewCDOResource.gif
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/icons/full/elcl16/NewCDOResource.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/icons/full/elcl16/NewCDOResourceFolder.gif b/plugins/org.eclipse.emf.cdo.ui.ide/icons/full/elcl16/NewCDOResourceFolder.gif
index 0afa73e8b9..138d0e9853 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/icons/full/elcl16/NewCDOResourceFolder.gif
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/icons/full/elcl16/NewCDOResourceFolder.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/icons/full/elcl16/NewCDOTextResource.gif b/plugins/org.eclipse.emf.cdo.ui.ide/icons/full/elcl16/NewCDOTextResource.gif
new file mode 100644
index 0000000000..31d8ff5d8f
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/icons/full/elcl16/NewCDOTextResource.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/icons/full/obj16/CDOBinaryResource.gif b/plugins/org.eclipse.emf.cdo.ui.ide/icons/full/obj16/CDOBinaryResource.gif
new file mode 100644
index 0000000000..463c38f026
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/icons/full/obj16/CDOBinaryResource.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/icons/full/obj16/CDOFileResource.gif b/plugins/org.eclipse.emf.cdo.ui.ide/icons/full/obj16/CDOFileResource.gif
new file mode 100644
index 0000000000..755b5bbad6
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/icons/full/obj16/CDOFileResource.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/icons/full/obj16/CDOResource.gif b/plugins/org.eclipse.emf.cdo.ui.ide/icons/full/obj16/CDOResource.gif
index acd9c16732..6968b7a7ba 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/icons/full/obj16/CDOResource.gif
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/icons/full/obj16/CDOResource.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/icons/full/obj16/CDOResourceFolder.gif b/plugins/org.eclipse.emf.cdo.ui.ide/icons/full/obj16/CDOResourceFolder.gif
index aa98255c29..3988005b7c 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/icons/full/obj16/CDOResourceFolder.gif
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/icons/full/obj16/CDOResourceFolder.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/icons/full/obj16/CDOTextResource.gif b/plugins/org.eclipse.emf.cdo.ui.ide/icons/full/obj16/CDOTextResource.gif
new file mode 100644
index 0000000000..560f25470f
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/icons/full/obj16/CDOTextResource.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/plugin.properties b/plugins/org.eclipse.emf.cdo.ui.ide/plugin.properties
index b2a032ea59..b9131f9f34 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/plugin.properties
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/plugin.properties
@@ -18,11 +18,15 @@ action.label.1 = New Folder...
action.label.2 = Remove
action.label.3 = New Resource...
action.label.4 = New Folder...
+action.label.15 = New Text Resource...
+action.label.16 = New Binary Resource...
action.tooltip = Creates a new resource in the selected container
action.tooltip.0 = Creates a new folder in the selected container
action.tooltip.1 = Removes the selected Node
action.tooltip.2 = Creates a new resource in the selected container
action.tooltip.3 = Creates a new folder in the selected container
+action.tooltip.12 = Creates a new text resource in the selected container
+action.tooltip.13 = Creates a new binary resource in the selected container
action.label.5 = Show Package Registry...
action.tooltip.4 = Open the Package Manager...
action.label.6 = Register Filesystem Packages...
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/plugin.xml b/plugins/org.eclipse.emf.cdo.ui.ide/plugin.xml
index 57369656ae..898081884d 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/plugin.xml
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/plugin.xml
@@ -145,11 +145,18 @@
tooltip="%action.tooltip.8">
</action>
<action
- class="org.eclipse.emf.cdo.ui.internal.ide.actions.NewResourceFolderActionDelegate"
- icon="icons/full/elcl16/NewCDOResourceFolder.gif"
- id="org.eclipse.emf.cdo.ui.ide.newResourceFolderAction"
- label="%action.label.4"
- tooltip="%action.tooltip.3">
+ class="org.eclipse.emf.cdo.ui.internal.ide.actions.NewBinaryResourceActionDelegate"
+ icon="icons/full/elcl16/NewCDOBinaryResource.gif"
+ id="org.eclipse.emf.cdo.ui.ide.createBinaryResourceAction"
+ label="%action.label.16"
+ tooltip="%action.tooltip.13">
+ </action>
+ <action
+ class="org.eclipse.emf.cdo.ui.internal.ide.actions.NewTextResourceActionDelegate"
+ icon="icons/full/elcl16/NewCDOTextResource.gif"
+ id="org.eclipse.emf.cdo.ui.ide.createTextResourceAction"
+ label="%action.label.15"
+ tooltip="%action.tooltip.12">
</action>
<action
class="org.eclipse.emf.cdo.ui.internal.ide.actions.NewResourceActionDelegate"
@@ -158,6 +165,13 @@
label="%action.label.3"
tooltip="%action.tooltip.2">
</action>
+ <action
+ class="org.eclipse.emf.cdo.ui.internal.ide.actions.NewResourceFolderActionDelegate"
+ icon="icons/full/elcl16/NewCDOResourceFolder.gif"
+ id="org.eclipse.emf.cdo.ui.ide.newResourceFolderAction"
+ label="%action.label.4"
+ tooltip="%action.tooltip.3">
+ </action>
</objectContribution>
<objectContribution
adaptable="false"
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/NewBinaryResourceActionDelegate.java b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/NewBinaryResourceActionDelegate.java
new file mode 100644
index 0000000000..0bdb3dc0f2
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/NewBinaryResourceActionDelegate.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Victor Roldan Betancort - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.emf.cdo.ui.internal.ide.actions;
+
+import org.eclipse.emf.cdo.eresource.CDOResourceNode;
+import org.eclipse.emf.cdo.eresource.EresourceFactory;
+import org.eclipse.emf.cdo.ui.internal.ide.messages.Messages;
+
+/**
+ * @author Eike Stepper
+ */
+public class NewBinaryResourceActionDelegate extends NewResourceNodeActionDelegate
+{
+ public NewBinaryResourceActionDelegate()
+ {
+ super(Messages.getString("NewBinaryResourceAction_0")); //$NON-NLS-1$
+ }
+
+ @Override
+ protected CDOResourceNode createNewResourceNode()
+ {
+ return EresourceFactory.eINSTANCE.createCDOBinaryResource();
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/NewTextResourceActionDelegate.java b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/NewTextResourceActionDelegate.java
new file mode 100644
index 0000000000..d778b3f14d
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/NewTextResourceActionDelegate.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Victor Roldan Betancort - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.emf.cdo.ui.internal.ide.actions;
+
+import org.eclipse.emf.cdo.eresource.CDOResourceNode;
+import org.eclipse.emf.cdo.eresource.EresourceFactory;
+import org.eclipse.emf.cdo.ui.internal.ide.messages.Messages;
+
+/**
+ * @author Eike Stepper
+ */
+public class NewTextResourceActionDelegate extends NewResourceNodeActionDelegate
+{
+ public NewTextResourceActionDelegate()
+ {
+ super(Messages.getString("NewTextResourceAction_0")); //$NON-NLS-1$
+ }
+
+ @Override
+ protected CDOResourceNode createNewResourceNode()
+ {
+ return EresourceFactory.eINSTANCE.createCDOTextResource();
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/messages/messages.properties b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/messages/messages.properties
index 6a203f96d6..9a98dbfe43 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/messages/messages.properties
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/messages/messages.properties
@@ -14,6 +14,8 @@ ImportResourceToFolderAction_0=Import Resource
ImportResourceToFolderAction_1=No URI has been introduced
NewResourceAction_0=Creating CDO resource
NewResourceFolderAction_0=Creating CDO folder
+NewTextResourceAction_0=Creating CDO text resource
+NewBinaryResourceAction_0=Creating CDO binary resource
NewResourceNodeAction_0=Enter the name
Node.0=Sessions
Node.1=Repository does not support branching
diff --git a/plugins/org.eclipse.emf.cdo.ui.shared/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.ui.shared/META-INF/MANIFEST.MF
index d1a6a4cd8e..9451a813d4 100644
--- a/plugins/org.eclipse.emf.cdo.ui.shared/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.ui.shared/META-INF/MANIFEST.MF
@@ -2,15 +2,15 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.emf.cdo.ui.shared;singleton:=true
-Bundle-Version: 4.0.100.qualifier
+Bundle-Version: 4.1.0.qualifier
Bundle-Activator: org.eclipse.emf.cdo.ui.internal.shared.bundle.OM$Activator
Bundle-Vendor: %providerName
Bundle-ClassPath: .
Bundle-Localization: plugin
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Export-Package: org.eclipse.emf.cdo.ui.shared;version="4.0.100",
- org.eclipse.emf.cdo.ui.internal.shared.bundle;version="4.0.100";x-internal:=true
+Export-Package: org.eclipse.emf.cdo.ui.shared;version="4.1.0",
+ org.eclipse.emf.cdo.ui.internal.shared.bundle;version="4.1.0";x-internal:=true
Require-Bundle: org.eclipse.ui;bundle-version="[3.4.0,4.0.0)",
org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
org.eclipse.net4j.util;bundle-version="[3.1.0,4.0.0)"
diff --git a/plugins/org.eclipse.emf.cdo.ui.shared/icons/full/etool16/NewCDOBinaryResource.gif b/plugins/org.eclipse.emf.cdo.ui.shared/icons/full/etool16/NewCDOBinaryResource.gif
new file mode 100644
index 0000000000..0b47c128eb
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ui.shared/icons/full/etool16/NewCDOBinaryResource.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo.ui.shared/icons/full/etool16/NewCDOResource.gif b/plugins/org.eclipse.emf.cdo.ui.shared/icons/full/etool16/NewCDOResource.gif
new file mode 100644
index 0000000000..094452ca19
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ui.shared/icons/full/etool16/NewCDOResource.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo.ui.shared/icons/full/etool16/NewCDOResourceFolder.gif b/plugins/org.eclipse.emf.cdo.ui.shared/icons/full/etool16/NewCDOResourceFolder.gif
new file mode 100644
index 0000000000..138d0e9853
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ui.shared/icons/full/etool16/NewCDOResourceFolder.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo.ui.shared/icons/full/etool16/NewCDOTextResource.gif b/plugins/org.eclipse.emf.cdo.ui.shared/icons/full/etool16/NewCDOTextResource.gif
new file mode 100644
index 0000000000..31d8ff5d8f
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ui.shared/icons/full/etool16/NewCDOTextResource.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo.ui.shared/src/org/eclipse/emf/cdo/ui/shared/SharedIcons.java b/plugins/org.eclipse.emf.cdo.ui.shared/src/org/eclipse/emf/cdo/ui/shared/SharedIcons.java
index 8401301b44..0e07a3702d 100644
--- a/plugins/org.eclipse.emf.cdo.ui.shared/src/org/eclipse/emf/cdo/ui/shared/SharedIcons.java
+++ b/plugins/org.eclipse.emf.cdo.ui.shared/src/org/eclipse/emf/cdo/ui/shared/SharedIcons.java
@@ -42,6 +42,26 @@ public class SharedIcons
public static final String ETOOL_OPEN_EDITOR = ETOOL + "open_editor" + IMAGE_FORMAT_GIF; //$NON-NLS-1$
+ /**
+ * @since 4.1
+ */
+ public static final String ETOOL_NEW_RESOURCE = ETOOL + "NewCDOResource" + IMAGE_FORMAT_GIF; //$NON-NLS-1$
+
+ /**
+ * @since 4.1
+ */
+ public static final String ETOOL_NEW_TEXT_RESOURCE = ETOOL + "NewCDOTextResource" + IMAGE_FORMAT_GIF; //$NON-NLS-1$
+
+ /**
+ * @since 4.1
+ */
+ public static final String ETOOL_NEW_BINARY_RESOURCE = ETOOL + "NewCDOBinaryResource" + IMAGE_FORMAT_GIF; //$NON-NLS-1$
+
+ /**
+ * @since 4.1
+ */
+ public static final String ETOOL_NEW_RESOURCE_FOLDER = ETOOL + "NewCDOResourceFolder" + IMAGE_FORMAT_GIF; //$NON-NLS-1$
+
public static final String OBJ_SESSION = OBJ + "cdo_session" + IMAGE_FORMAT_GIF; //$NON-NLS-1$
public static final String OBJ_SESSION_SYNCING = OBJ + "cdo_session_syncing" + IMAGE_FORMAT_GIF; //$NON-NLS-1$
@@ -60,6 +80,16 @@ public class SharedIcons
public static final String OBJ_RESOURCE = OBJ + "CDOResource" + IMAGE_FORMAT_GIF; //$NON-NLS-1$
+ /**
+ * @since 4.1
+ */
+ public static final String OBJ_TEXT_RESOURCE = OBJ + "CDOTextResource" + IMAGE_FORMAT_GIF; //$NON-NLS-1$
+
+ /**
+ * @since 4.1
+ */
+ public static final String OBJ_BINARY_RESOURCE = OBJ + "CDOBinaryResource" + IMAGE_FORMAT_GIF; //$NON-NLS-1$
+
public static final String OBJ_RESOURCE_FOLDER = OBJ + "CDOResourceFolder" + IMAGE_FORMAT_GIF; //$NON-NLS-1$
public static final String OBJ_EPACKAGE_CONVERTED = OBJ + "EPackageConverted" + IMAGE_FORMAT_GIF; //$NON-NLS-1$
diff --git a/plugins/org.eclipse.emf.cdo.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.ui/META-INF/MANIFEST.MF
index ce1cedac9b..c58abe70b2 100644
--- a/plugins/org.eclipse.emf.cdo.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.emf.cdo.ui;singleton:=true
-Bundle-Version: 4.1.100.qualifier
+Bundle-Version: 4.2.0.qualifier
Bundle-Activator: org.eclipse.emf.cdo.internal.ui.bundle.OM$Activator
Bundle-Vendor: %providerName
Bundle-ClassPath: .
@@ -21,70 +21,70 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
org.eclipse.emf.cdo;bundle-version="[4.0.0,5.0.0)";visibility:=reexport,
org.eclipse.emf.cdo.edit;bundle-version="[4.0.0,5.0.0)";visibility:=reexport,
org.eclipse.emf.cdo.ui.shared;bundle-version="[4.0.0,5.0.0)"
-Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.1.100";
+Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.2.0";
x-friends:="org.eclipse.emf.cdo.ui.defs,
org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
org.eclipse.emf.cdo.tests.ui,
org.eclipse.emf.cdo.dawn.ui,
org.eclipse.emf.cdo.explorer",
- org.eclipse.emf.cdo.internal.ui.actions;version="4.1.100";
+ org.eclipse.emf.cdo.internal.ui.actions;version="4.2.0";
x-friends:="org.eclipse.emf.cdo.ui.defs,
org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
org.eclipse.emf.cdo.tests.ui,
org.eclipse.emf.cdo.dawn.ui,
org.eclipse.emf.cdo.explorer",
- org.eclipse.emf.cdo.internal.ui.bundle;version="4.1.100";x-internal:=true,
- org.eclipse.emf.cdo.internal.ui.dialogs;version="4.1.100";
+ org.eclipse.emf.cdo.internal.ui.bundle;version="4.2.0";x-internal:=true,
+ org.eclipse.emf.cdo.internal.ui.dialogs;version="4.2.0";
x-friends:="org.eclipse.emf.cdo.ui.defs,
org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
org.eclipse.emf.cdo.tests.ui,
org.eclipse.emf.cdo.dawn.ui,
org.eclipse.emf.cdo.explorer",
- org.eclipse.emf.cdo.internal.ui.dnd;version="4.1.100";
+ org.eclipse.emf.cdo.internal.ui.dnd;version="4.2.0";
x-friends:="org.eclipse.emf.cdo.ui.defs,
org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
org.eclipse.emf.cdo.tests.ui,
org.eclipse.emf.cdo.dawn.ui,
org.eclipse.emf.cdo.explorer",
- org.eclipse.emf.cdo.internal.ui.editor;version="4.1.100";
+ org.eclipse.emf.cdo.internal.ui.editor;version="4.2.0";
x-friends:="org.eclipse.emf.cdo.ui.defs,
org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
org.eclipse.emf.cdo.tests.ui,
org.eclipse.emf.cdo.dawn.ui,
org.eclipse.emf.cdo.explorer",
- org.eclipse.emf.cdo.internal.ui.filters;version="4.1.100";
+ org.eclipse.emf.cdo.internal.ui.filters;version="4.2.0";
x-friends:="org.eclipse.emf.cdo.ui.defs,
org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
org.eclipse.emf.cdo.tests.ui,
org.eclipse.emf.cdo.dawn.ui,
org.eclipse.emf.cdo.explorer",
- org.eclipse.emf.cdo.internal.ui.messages;version="4.1.100";x-friends:="org.eclipse.emf.cdo.tests.ui",
- org.eclipse.emf.cdo.internal.ui.perspectives;version="4.1.100";
+ org.eclipse.emf.cdo.internal.ui.messages;version="4.2.0";x-friends:="org.eclipse.emf.cdo.tests.ui",
+ org.eclipse.emf.cdo.internal.ui.perspectives;version="4.2.0";
x-friends:="org.eclipse.emf.cdo.ui.defs,
org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
org.eclipse.emf.cdo.tests.ui,
org.eclipse.emf.cdo.dawn.ui,
org.eclipse.emf.cdo.explorer",
- org.eclipse.emf.cdo.internal.ui.preferences;version="4.1.100";
+ org.eclipse.emf.cdo.internal.ui.preferences;version="4.2.0";
x-friends:="org.eclipse.emf.cdo.ui.defs,
org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
org.eclipse.emf.cdo.tests.ui,
org.eclipse.emf.cdo.dawn.ui,
org.eclipse.emf.cdo.explorer",
- org.eclipse.emf.cdo.internal.ui.views;version="4.1.100";
+ org.eclipse.emf.cdo.internal.ui.views;version="4.2.0";
x-friends:="org.eclipse.emf.cdo.ui.defs,
org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
org.eclipse.emf.cdo.tests.ui,
org.eclipse.emf.cdo.dawn.ui,
org.eclipse.emf.cdo.explorer",
- org.eclipse.emf.cdo.ui;version="4.1.100",
- org.eclipse.emf.cdo.ui.widgets;version="4.1.100"
+ org.eclipse.emf.cdo.ui;version="4.2.0",
+ org.eclipse.emf.cdo.ui.widgets;version="4.2.0"
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/CreateResourceNodeAction.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/CreateResourceNodeAction.java
index c1780ff876..83bcb17c10 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/CreateResourceNodeAction.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/CreateResourceNodeAction.java
@@ -19,10 +19,12 @@ import org.eclipse.emf.cdo.internal.ui.messages.Messages;
import org.eclipse.emf.cdo.transaction.CDOTransaction;
import org.eclipse.emf.cdo.ui.CDOEditorUtil;
import org.eclipse.emf.cdo.ui.CDOItemProvider;
+import org.eclipse.emf.cdo.ui.shared.SharedIcons;
import org.eclipse.emf.cdo.view.CDOView;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.IWorkbenchPage;
/**
@@ -30,38 +32,29 @@ import org.eclipse.ui.IWorkbenchPage;
*/
public class CreateResourceNodeAction extends ViewAction
{
- private static final String TITLE_RESOURCE = Messages.getString("CreateResourceAction.0"); //$NON-NLS-1$
-
- private static final String TITLE_FOLDER = Messages.getString("CreateResourceNodeAction.0"); //$NON-NLS-1$
-
- private static final String TOOL_TIP_RESOURCE = Messages.getString("CreateResourceAction.1"); //$NON-NLS-1$
-
- private static final String TOOL_TIP_FOLDER = Messages.getString("CreateResourceNodeAction.1"); //$NON-NLS-1$
-
private CDOItemProvider itemProvider;
private CDOResourceNode selectedNode;
- private boolean createFolder;
+ private Type type;
private String resourceNodeName;
public CreateResourceNodeAction(CDOItemProvider itemProvider, IWorkbenchPage page, CDOView view,
- CDOResourceNode node, boolean createFolder)
+ CDOResourceNode node, Type type)
{
- super(page, createFolder ? TITLE_FOLDER + INTERACTIVE : TITLE_RESOURCE + INTERACTIVE,
- createFolder ? TOOL_TIP_FOLDER : TOOL_TIP_RESOURCE, null, view);
+ super(page, type.getTitle() + INTERACTIVE, type.getTooltip(), type.getImageDescriptor(), view);
selectedNode = node;
this.itemProvider = itemProvider;
- this.createFolder = createFolder;
+ this.type = type;
}
@Override
protected void preRun() throws Exception
{
- InputDialog dialog = new InputDialog(getShell(), createFolder ? TITLE_FOLDER : TITLE_RESOURCE,
- createFolder ? "Enter folder name" : Messages.getString("CreateResourceAction.2"), "res" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- + (ViewAction.lastResourceNumber + 1), new ResourceNodeNameInputValidator(selectedNode));
+ InputDialog dialog = new InputDialog(getShell(), type.getTitle(), Messages.getString("CreateResourceNodeAction.8"),
+ (type == Type.FOLDER ? "folder" : "resource") + (ViewAction.lastResourceNumber + 1),
+ new ResourceNodeNameInputValidator(selectedNode));
if (dialog.open() == InputDialog.OK)
{
@@ -80,8 +73,9 @@ public class CreateResourceNodeAction extends ViewAction
CDOTransaction transaction = getTransaction();
CDOResourceNode node = null;
- if (createFolder)
+ switch (type)
{
+ case FOLDER:
node = EresourceFactory.eINSTANCE.createCDOResourceFolder();
node.setName(resourceNodeName);
if (selectedNode instanceof CDOResourceFolder)
@@ -90,11 +84,12 @@ public class CreateResourceNodeAction extends ViewAction
}
else
{
- ((CDOResource)selectedNode).getContents().add(node);
+ ((CDOResource)selectedNode).getContents().add(node); // selectedNode is root resource
}
- }
- else
- {
+
+ break;
+
+ case MODEL:
if (selectedNode instanceof CDOResourceFolder)
{
node = transaction.createResource(selectedNode.getPath() + "/" + resourceNodeName); //$NON-NLS-1$
@@ -103,6 +98,32 @@ public class CreateResourceNodeAction extends ViewAction
{
node = transaction.createResource(resourceNodeName);
}
+
+ break;
+
+ case TEXT:
+ if (selectedNode instanceof CDOResourceFolder)
+ {
+ node = transaction.createTextResource(selectedNode.getPath() + "/" + resourceNodeName); //$NON-NLS-1$
+ }
+ else
+ {
+ node = transaction.createTextResource(resourceNodeName);
+ }
+
+ break;
+
+ case BINARY:
+ if (selectedNode instanceof CDOResourceFolder)
+ {
+ node = transaction.createBinaryResource(selectedNode.getPath() + "/" + resourceNodeName); //$NON-NLS-1$
+ }
+ else
+ {
+ node = transaction.createBinaryResource(resourceNodeName);
+ }
+
+ break;
}
transaction.commit();
@@ -110,10 +131,56 @@ public class CreateResourceNodeAction extends ViewAction
itemProvider.refreshViewer(true);
itemProvider.selectElement(node, true);
- if (!createFolder)
+ if (type == Type.MODEL)
{
String resourcePath = node.getPath();
CDOEditorUtil.openEditor(getPage(), transaction, resourcePath);
}
}
+
+ /**
+ * @author Eike Stepper
+ */
+ public static enum Type
+ {
+ FOLDER(Messages.getString("Title.Folder"), Messages.getString("Tooltip.Folder"), SharedIcons
+ .getDescriptor(SharedIcons.ETOOL_NEW_RESOURCE_FOLDER)),
+
+ MODEL(Messages.getString("Title.Model"), Messages.getString("Tooltip.Model"), SharedIcons
+ .getDescriptor(SharedIcons.ETOOL_NEW_RESOURCE)),
+
+ TEXT(Messages.getString("Title.Text"), Messages.getString("Tooltip.Text"), SharedIcons
+ .getDescriptor(SharedIcons.ETOOL_NEW_TEXT_RESOURCE)),
+
+ BINARY(Messages.getString("Title.Binary"), Messages.getString("Tooltip.Binary"), SharedIcons
+ .getDescriptor(SharedIcons.ETOOL_NEW_BINARY_RESOURCE));
+
+ private String title;
+
+ private String tooltip;
+
+ private ImageDescriptor imageDescriptor;
+
+ private Type(String title, String tooltip, ImageDescriptor imageDescriptor)
+ {
+ this.title = title;
+ this.tooltip = tooltip;
+ this.imageDescriptor = imageDescriptor;
+ }
+
+ public String getTitle()
+ {
+ return title;
+ }
+
+ public String getTooltip()
+ {
+ return tooltip;
+ }
+
+ public ImageDescriptor getImageDescriptor()
+ {
+ return imageDescriptor;
+ }
+ }
}
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenFileEditorAction.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenFileEditorAction.java
new file mode 100644
index 0000000000..56a28ab719
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenFileEditorAction.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ * Victor Roldan Betancort - maintenance
+ */
+package org.eclipse.emf.cdo.internal.ui.actions;
+
+import org.eclipse.emf.cdo.eresource.CDOResourceNode;
+import org.eclipse.emf.cdo.internal.ui.messages.Messages;
+import org.eclipse.emf.cdo.ui.CDOEditorUtil;
+import org.eclipse.emf.cdo.view.CDOView;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.ui.IWorkbenchPage;
+
+/**
+ * @author Eike Stepper
+ */
+public final class OpenFileEditorAction extends ResourceNodeAction
+{
+ private static final String TITLE = Messages.getString("OpenFileEditorAction.0"); //$NON-NLS-1$
+
+ private static final String TOOL_TIP = Messages.getString("OpenFileEditorAction.1"); //$NON-NLS-1$
+
+ public OpenFileEditorAction(IWorkbenchPage page, CDOResourceNode resourceNode)
+ {
+ super(page, TITLE, TOOL_TIP, null, resourceNode);
+ }
+
+ @Override
+ protected void doRun(IProgressMonitor progressMonitor) throws Exception
+ {
+ CDOView view = getResourceNode().cdoView();
+ String resourcePath = getResourceNode().getPath();
+ CDOEditorUtil.openEditor(getPage(), view, resourcePath);
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/messages/messages.properties b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/messages/messages.properties
index 3930a453ec..9256f03cc7 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/messages/messages.properties
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/messages/messages.properties
@@ -105,13 +105,19 @@ CloseViewAction.1=Close the CDO view
CloseViewAction.2=You have uncommitted changes. Do you want to discard them?
CommitTransactionAction.0=Commit
CommitTransactionAction.1=Commit this transaction
-CreateResourceAction.0=Create Resource
-CreateResourceAction.1=Create a CDO resource
CreateResourceAction.2=Enter resource name:
CreateResourceAction.4=Resource already exists
CreateResourceAction.5=There already exists a resource with path "{0}". Do you want to edit the resource?
-CreateResourceNodeAction.0=Create Folder
-CreateResourceNodeAction.1=Create a new CDOResourceFolder
+
+Title.Folder=Create Folder
+Tooltip.Folder=Create a new resource folder
+Title.Model=Create Resource
+Tooltip.Model=Create a new model resource
+Title.Text=Create Text Resource
+Tooltip.Text=Create a new text resource
+Title.Binary=Create Binary Resource
+Tooltip.Binary=Create a new binary resource
+
CreateResourceNodeAction.2=Relative names not allowed
CreateResourceNodeAction.3=Folder name cannot be empty
CreateResourceNodeAction.4=Resource name cannot be empty
@@ -143,8 +149,10 @@ OpenDurableViewAction.0=Open Durable View
OpenDurableViewAction.1=Open a durable CDO view
OpenDurableViewDialog.0=Open Durable View
OpenDurableViewDialog.1=Area ID:
+OpenFileEditorAction.0=Open File Editor
+OpenFileEditorAction.1=Open a file editor for this resource
OpenResourceEditorAction.0=Open Editor
-OpenResourceEditorAction.1=Open a CDO editor for this resource
+OpenResourceEditorAction.1=Open a model editor for this resource
OpenResourcesDialog.0=Open Resources
OpenSessionAction.0=Open a new CDO session
OpenSessionAction.3=Unable to open a session on the specified repository.\n\n
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOSessionsView.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOSessionsView.java
index 68fe6d885e..b5b6c2a18f 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOSessionsView.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOSessionsView.java
@@ -10,8 +10,11 @@
*/
package org.eclipse.emf.cdo.internal.ui.views;
+import org.eclipse.emf.cdo.common.lob.CDOClob;
import org.eclipse.emf.cdo.eresource.CDOResource;
+import org.eclipse.emf.cdo.eresource.CDOTextResource;
import org.eclipse.emf.cdo.internal.ui.actions.OpenSessionAction;
+import org.eclipse.emf.cdo.internal.ui.bundle.OM;
import org.eclipse.emf.cdo.session.CDOSession;
import org.eclipse.emf.cdo.ui.CDOEditorUtil;
import org.eclipse.emf.cdo.ui.CDOItemProvider;
@@ -19,16 +22,31 @@ import org.eclipse.emf.cdo.ui.CDOItemProvider;
import org.eclipse.net4j.util.container.IContainer;
import org.eclipse.net4j.util.container.IManagedContainer;
import org.eclipse.net4j.util.container.IPluginContainer;
+import org.eclipse.net4j.util.io.IORuntimeException;
import org.eclipse.net4j.util.ui.views.ContainerItemProvider;
import org.eclipse.net4j.util.ui.views.ContainerView;
import org.eclipse.net4j.util.ui.views.IElementFilter;
+import org.eclipse.emf.ecore.resource.URIConverter;
+
+import org.eclipse.core.resources.IStorage;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IPersistableElement;
+import org.eclipse.ui.IStorageEditorInput;
import org.eclipse.ui.IWorkbenchPage;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@@ -84,6 +102,8 @@ public class CDOSessionsView extends ContainerView
@Override
protected void doubleClicked(Object object)
{
+ final IWorkbenchPage page = getSite().getPage();
+
if (object instanceof CDOResource)
{
CDOResource resource = (CDOResource)object;
@@ -93,13 +113,109 @@ public class CDOSessionsView extends ContainerView
ResourceOpener opener = resourceOpeners.get(extension);
if (opener != null)
{
- opener.openResource(getSite().getPage(), resource);
+ opener.openResource(page, resource);
}
else
{
- CDOEditorUtil.openEditor(getSite().getPage(), resource.cdoView(), path);
+ CDOEditorUtil.openEditor(page, resource.cdoView(), path);
}
}
+ else if (object instanceof CDOTextResource)
+ {
+ final CDOTextResource resource = (CDOTextResource)object;
+ final IPath path = new Path(resource.getPath());
+
+ Display display = page.getWorkbenchWindow().getShell().getDisplay();
+ display.asyncExec(new Runnable()
+ {
+ public void run()
+ {
+ try
+ {
+ IEditorInput input = new IStorageEditorInput()
+ {
+ public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter)
+ {
+ System.out.println("IStorageEditorInput: " + adapter);
+ return Platform.getAdapterManager().getAdapter(this, adapter);
+ }
+
+ public String getToolTipText()
+ {
+ return path.toString();
+ }
+
+ public IPersistableElement getPersistable()
+ {
+ return null;
+ }
+
+ public String getName()
+ {
+ return path.lastSegment();
+ }
+
+ public ImageDescriptor getImageDescriptor()
+ {
+ return null;
+ }
+
+ public boolean exists()
+ {
+ return true;
+ }
+
+ public IStorage getStorage() throws CoreException
+ {
+ return new IStorage()
+ {
+ public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter)
+ {
+ System.out.println("IStorage: " + adapter);
+ return Platform.getAdapterManager().getAdapter(this, adapter);
+ }
+
+ public boolean isReadOnly()
+ {
+ return false;
+ }
+
+ public String getName()
+ {
+ return path.lastSegment();
+ }
+
+ public IPath getFullPath()
+ {
+ return path;
+ }
+
+ public InputStream getContents() throws CoreException
+ {
+ try
+ {
+ CDOClob clob = resource.getContents();
+ Reader reader = clob.getContents();
+ return new URIConverter.ReadableInputStream(reader);
+ }
+ catch (IOException ex)
+ {
+ throw new IORuntimeException(ex);
+ }
+ }
+ };
+ }
+ };
+
+ page.openEditor(input, CDOEditorUtil.getEditorID());
+ }
+ catch (Exception ex)
+ {
+ OM.LOG.error(ex);
+ }
+ }
+ });
+ }
else
{
super.doubleClicked(object);
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/CDOItemProvider.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/CDOItemProvider.java
index 27e092df41..52d7ccae30 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/CDOItemProvider.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/CDOItemProvider.java
@@ -17,9 +17,11 @@ import org.eclipse.emf.cdo.common.branch.CDOBranchManager;
import org.eclipse.emf.cdo.common.model.CDOPackageRegistry;
import org.eclipse.emf.cdo.common.model.CDOPackageTypeRegistry;
import org.eclipse.emf.cdo.common.model.CDOPackageUnit.Type;
+import org.eclipse.emf.cdo.eresource.CDOBinaryResource;
import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.eresource.CDOResourceFolder;
import org.eclipse.emf.cdo.eresource.CDOResourceNode;
+import org.eclipse.emf.cdo.eresource.CDOTextResource;
import org.eclipse.emf.cdo.internal.ui.actions.CloseSessionAction;
import org.eclipse.emf.cdo.internal.ui.actions.CloseViewAction;
import org.eclipse.emf.cdo.internal.ui.actions.CommitTransactionAction;
@@ -241,6 +243,16 @@ public class CDOItemProvider extends ContainerItemProvider<IContainer<Object>>
return SharedIcons.getImage(SharedIcons.OBJ_RESOURCE);
}
+ if (obj instanceof CDOTextResource)
+ {
+ return SharedIcons.getImage(SharedIcons.OBJ_TEXT_RESOURCE);
+ }
+
+ if (obj instanceof CDOBinaryResource)
+ {
+ return SharedIcons.getImage(SharedIcons.OBJ_BINARY_RESOURCE);
+ }
+
return super.getImage(obj);
}
@@ -274,13 +286,21 @@ public class CDOItemProvider extends ContainerItemProvider<IContainer<Object>>
{
fillView(manager, (CDOView)object);
}
+ else if (object instanceof CDOResourceFolder)
+ {
+ fillResourceFolder(manager, (CDOResourceFolder)object);
+ }
else if (object instanceof CDOResource)
{
fillResource(manager, (CDOResource)object);
}
- else if (object instanceof CDOResourceFolder)
+ else if (object instanceof CDOTextResource)
{
- fillResourceFolder(manager, (CDOResourceFolder)object);
+ fillTextResource(manager, (CDOTextResource)object);
+ }
+ else if (object instanceof CDOBinaryResource)
+ {
+ fillBinaryResource(manager, (CDOBinaryResource)object);
}
}
}
@@ -301,6 +321,22 @@ public class CDOItemProvider extends ContainerItemProvider<IContainer<Object>>
}
/**
+ * @since 4.2
+ */
+ protected void fillTextResource(IMenuManager manager, CDOTextResource resource)
+ {
+ manager.add(new OpenResourceEditorAction(page, resource));
+ }
+
+ /**
+ * @since 4.2
+ */
+ protected void fillBinaryResource(IMenuManager manager, CDOBinaryResource resource)
+ {
+ manager.add(new OpenResourceEditorAction(page, resource));
+ }
+
+ /**
* @since 2.0
*/
protected void fillSession(IMenuManager manager, CDOSession session)
@@ -387,12 +423,15 @@ public class CDOItemProvider extends ContainerItemProvider<IContainer<Object>>
manager.add(new OpenViewEditorAction(page, view));
manager.add(new LoadResourceAction(page, view));
manager.add(new ExportResourceAction(page, view));
+
manager.add(new Separator());
if (!view.isReadOnly())
{
CDOResource rootResource = view.getRootResource();
- manager.add(new CreateResourceNodeAction(this, page, view, rootResource, false));
- manager.add(new CreateResourceNodeAction(this, page, view, rootResource, true));
+ manager.add(new CreateResourceNodeAction(this, page, view, rootResource, CreateResourceNodeAction.Type.FOLDER));
+ manager.add(new CreateResourceNodeAction(this, page, view, rootResource, CreateResourceNodeAction.Type.MODEL));
+ manager.add(new CreateResourceNodeAction(this, page, view, rootResource, CreateResourceNodeAction.Type.TEXT));
+ manager.add(new CreateResourceNodeAction(this, page, view, rootResource, CreateResourceNodeAction.Type.BINARY));
manager.add(new ImportResourceAction(page, view));
manager.add(new CommitTransactionAction(page, view));
manager.add(new RollbackTransactionAction(page, view));

Back to the top