diff options
Diffstat (limited to 'plugins')
8 files changed, 196 insertions, 25 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 diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java index 81bccbeacd..5df27083bb 100644 --- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java +++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java @@ -1541,7 +1541,7 @@ public class CDOEditor extends MultiPageEditorPart implements IEditingDomainProv // contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); - contentOutlineViewer.setInput(editingDomain.getResourceSet()); + contentOutlineViewer.setInput(viewerInput); // Make sure our popups work. // @@ -2455,11 +2455,11 @@ public class CDOEditor extends MultiPageEditorPart implements IEditingDomainProv /** * Returns whether the outline view should be presented to the user. <!-- begin-user-doc --> <!-- end-user-doc --> * - * @generated + * @generated NOT */ protected boolean showOutlineView() { - return false; + return true; } /** 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 18a7dc01e0..56750b22b9 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 @@ -31,7 +31,7 @@ BulkAddDialog.2=Type: BulkAddDialog.3=Instances: BulkAddDialog.4=Select a feature BulkAddDialog.5=Enter a valid number of instances (>0) -CDOActionBarContributor_0=Locking +CDOActionBarContributor_0=Lock CDOEditor.0=Target Time CDOEditor.1=Open Target Time Slider CDOEditor.17=Transaction error @@ -159,7 +159,7 @@ PackageRegistryDialog.5=Generated... PackageRegistryDialog.6=Workspace... PackageRegistryDialog.7=Filesystem... PackageRegistryDialog.8=? -ReadLockObjectsAction.1=ReadLock +ReadLockObjectsAction.1=Read Lock RegisterFilesystemPackagesAction.0=Register Filesystem Packages RegisterFilesystemPackagesAction.1=Register dynamic packages from the filesystem RegisterFilesystemPackagesAction.2=Ecore models (*.ecore) @@ -194,4 +194,4 @@ SessionComposite.0=Server Description: SessionComposite.1=for example 'tcp://dev.eclipse.org:2036' SessionComposite.2=Repository Name: SessionComposite.3=Automatic Package Registry -WriteLockObjectsAction.1=WriteLock +WriteLockObjectsAction.1=Write Lock |