Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Roldan Betancort2010-03-16 12:44:53 +0000
committerVictor Roldan Betancort2010-03-16 12:44:53 +0000
commitb706f82b6d9d3d5045adc3a3824c509e02e87a70 (patch)
treee603b0f2952e86371dfaf67de66e75c7e665e208 /plugins/org.eclipse.emf.cdo.ui.ide
parent0bebbd3f90a3fa2d5e023a6b248111ad70a1619a (diff)
downloadcdo-b706f82b6d9d3d5045adc3a3824c509e02e87a70.tar.gz
cdo-b706f82b6d9d3d5045adc3a3824c509e02e87a70.tar.xz
cdo-b706f82b6d9d3d5045adc3a3824c509e02e87a70.zip
- Fixed several issues described in the UI document
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.ui.ide')
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/plugin.properties27
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/plugin.xml25
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/ChangeViewTargetActionDelegate.java38
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/RenameResourceNodeActionDelegate.java76
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/ViewAwareActionDelegate.java42
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/messages/messages.properties1
6 files changed, 190 insertions, 19 deletions
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/plugin.properties b/plugins/org.eclipse.emf.cdo.ui.ide/plugin.properties
index 06ebce050f..c4e4d5ae1c 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/plugin.properties
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/plugin.properties
@@ -27,29 +27,32 @@ providerName = Eclipse Modeling Project
wizard.name = CDO
navigatorContent.name = CDO Repository Content
action.label = Disconnect
-action.label.0 = New Resource
-action.label.1 = New Folder
+action.label.0 = New Resource...
+action.label.1 = New Folder...
action.label.2 = Remove
-action.label.3 = New Resource
-action.label.4 = New Folder
+action.label.3 = New Resource...
+action.label.4 = New Folder...
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.label.5 = Show Package Registry...
-action.tooltip.4 = Open the Package Manager
-action.label.6 = Register Filesystem Packages
+action.tooltip.4 = Open the Package Manager...
+action.label.6 = Register Filesystem Packages...
action.tooltip.5 = Register a model by browsing the file system
-action.label.7 = Register Workspace Packages
+action.label.7 = Register Workspace Packages...
action.tooltip.6 = Register a model by browsing the workspace
-action.label.8 = Import Resource
+action.label.8 = Import...
action.tooltip.7 = Imports an external resource into the repository root
-action.label.9 = Import Resource
+action.label.9 = Import...
action.tooltip.8 = Imports an external resource into the selected folder
-action.label.10 = Export Resource
-action.label.11 = Create New Branch
+action.label.10 = Export...
+action.label.11 = New Branch...
action.tooltip.9 = Creates a new sub branch of the selected branch
action.label.12 = Switch To
action.tooltip.10 = Switches the project to the selected branch
-wizard.name.0 = CDO Project \ No newline at end of file
+wizard.name.0 = CDO Project
+action.label.13 = Rename...
+action.tooltip.11 = Change the name of this resource node
+action.label.14 = Change Target... \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/plugin.xml b/plugins/org.eclipse.emf.cdo.ui.ide/plugin.xml
index 1c6d5f8317..b64b6b6471 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/plugin.xml
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/plugin.xml
@@ -108,6 +108,11 @@
label="%action.label.0"
tooltip="%action.tooltip">
</action>
+ <action
+ class="org.eclipse.emf.cdo.ui.internal.ide.actions.ChangeViewTargetActionDelegate"
+ id="org.eclipse.emf.cdo.ui.ide.changeViewTarget"
+ label="%action.label.14">
+ </action>
</objectContribution>
<objectContribution
adaptable="true"
@@ -120,6 +125,12 @@
label="%action.label.2"
tooltip="%action.tooltip.1">
</action>
+ <action
+ class="org.eclipse.emf.cdo.ui.internal.ide.actions.RenameResourceNodeActionDelegate"
+ id="org.eclipse.emf.cdo.ui.ide.renameResourceNodeAction"
+ label="%action.label.13"
+ tooltip="%action.tooltip.11">
+ </action>
</objectContribution>
<objectContribution
adaptable="true"
@@ -189,19 +200,19 @@
id="org.eclipse.emf.cdo.ui.ide.BranchesNodeActions"
objectClass="org.eclipse.emf.cdo.ui.ide.Node$BranchNode">
<action
- class="org.eclipse.emf.cdo.ui.internal.ide.actions.CreateBranchActionDelegate"
- icon="icons/full/obj16/fork.png"
- id="org.eclipse.emf.cdo.ui.ide.createNewBranchAction"
- label="%action.label.11"
- tooltip="%action.tooltip.9">
- </action>
- <action
class="org.eclipse.emf.cdo.ui.internal.ide.actions.SwitchToBranchActionDelegate"
icon="icons/full/obj16/switch.png"
id="org.eclipse.emf.cdo.ui.ide.switchToBranchAction"
label="%action.label.12"
tooltip="%action.tooltip.10">
</action>
+ <action
+ class="org.eclipse.emf.cdo.ui.internal.ide.actions.CreateBranchActionDelegate"
+ icon="icons/full/obj16/fork.png"
+ id="org.eclipse.emf.cdo.ui.ide.createNewBranchAction"
+ label="%action.label.11"
+ tooltip="%action.tooltip.9">
+ </action>
</objectContribution>
</extension>
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/ChangeViewTargetActionDelegate.java b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/ChangeViewTargetActionDelegate.java
new file mode 100644
index 0000000000..acbed12fc0
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/ChangeViewTargetActionDelegate.java
@@ -0,0 +1,38 @@
+/**
+ * Copyright (c) 2004 - 2010 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.internal.ui.actions.ChangeViewTargetAction;
+
+import org.eclipse.jface.action.IAction;
+
+/**
+ * @author Victor Roldan Betancort
+ */
+public class ChangeViewTargetActionDelegate extends ViewAwareActionDelegate
+{
+ private IAction action;
+
+ public ChangeViewTargetActionDelegate()
+ {
+ }
+
+ @Override
+ protected void safeRun() throws Exception
+ {
+ if (action == null)
+ {
+ action = new ChangeViewTargetAction(getPage(), getView());
+ }
+ action.run();
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/RenameResourceNodeActionDelegate.java b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/RenameResourceNodeActionDelegate.java
new file mode 100644
index 0000000000..2931cadf46
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/RenameResourceNodeActionDelegate.java
@@ -0,0 +1,76 @@
+/**
+ * Copyright (c) 2004 - 2010 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.CDOObject;
+import org.eclipse.emf.cdo.eresource.CDOResourceNode;
+import org.eclipse.emf.cdo.internal.ui.actions.ResourceNodeNameInputValidator;
+import org.eclipse.emf.cdo.transaction.CDOTransaction;
+import org.eclipse.emf.cdo.ui.internal.ide.messages.Messages;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.InputDialog;
+
+/**
+ * @author Victor Roldan Betancort
+ */
+public class RenameResourceNodeActionDelegate extends TransactionalBackgroundActionDelegate
+{
+ private String newResourceName;
+
+ public RenameResourceNodeActionDelegate()
+ {
+ super(Messages.getString("RenameResourceNodeActionDelegate.0")); //$NON-NLS-1$
+ }
+
+ @Override
+ protected CDOObject preRun(CDOObject object)
+ {
+ InputDialog dialog = new InputDialog(getTargetPart().getSite().getShell(), getText(), Messages
+ .getString("NewResourceNodeAction_0"), null, new ResourceNodeNameInputValidator((CDOResourceNode)object)); //$NON-NLS-1$
+ if (dialog.open() == Dialog.OK)
+ {
+ setNewResourceName(dialog.getValue());
+ return super.preRun(object);
+ }
+
+ cancel();
+
+ return null;
+ }
+
+ private void setNewResourceName(String newName)
+ {
+ newResourceName = newName;
+ }
+
+ private String getNewResourceName()
+ {
+ return newResourceName;
+ }
+
+ @Override
+ protected final void doRun(CDOTransaction transaction, CDOObject object, IProgressMonitor progressMonitor)
+ throws Exception
+ {
+ if (object instanceof CDOResourceNode)
+ {
+ ((CDOResourceNode)object).setName(getNewResourceName());
+ }
+ else
+ {
+ throw new IllegalArgumentException("object is not a CDOResourceNode"); //$NON-NLS-1$
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/ViewAwareActionDelegate.java b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/ViewAwareActionDelegate.java
new file mode 100644
index 0000000000..37976a3cf9
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/ViewAwareActionDelegate.java
@@ -0,0 +1,42 @@
+/**
+ * Copyright (c) 2004 - 2010 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.ui.ide.Node;
+import org.eclipse.emf.cdo.view.CDOView;
+
+import org.eclipse.net4j.util.ui.UIUtil;
+import org.eclipse.net4j.util.ui.actions.SafeActionDelegate;
+
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * @author Victor Roldan Betancort
+ */
+public abstract class ViewAwareActionDelegate extends SafeActionDelegate
+{
+ public ViewAwareActionDelegate()
+ {
+ }
+
+ public CDOView getView()
+ {
+ Node node = UIUtil.getElement(getSelection(), Node.class);
+ return node.getRepositoryProject().getView();
+ }
+
+ public IWorkbenchPage getPage()
+ {
+ return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ }
+}
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 8e4e252a97..e597aad568 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
@@ -23,6 +23,7 @@ RemoveResourceAction_2=Are you sure you want to delete the selected {0} item(s)?
RemoveResourceAction_3=Deleting CDOResource(s)
RemoveResourceAction_4={0}: Cannot perform commit
RemoveResourceAction_5={0} element(s) removed
+RenameResourceNodeActionDelegate.0=Rename
TeamConfigurationWizard_1=Share Project to CDO
TeamConfigurationWizard_2=Enter CDO repository location information
TeamConfigurationWizard_3=Provide a URL to the target server and a repository name

Back to the top