Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2012-07-19 08:22:04 +0000
committerEike Stepper2012-07-19 08:22:04 +0000
commit1460904fd3c193ffaf809913b2983a400fce9d94 (patch)
tree72f3a17b75fedba3ae1060df1d32c9c7889be954 /plugins/org.eclipse.emf.cdo.ui.location
parent5f360965ae87478e0681899bf310a210cafc2c44 (diff)
downloadcdo-1460904fd3c193ffaf809913b2983a400fce9d94.tar.gz
cdo-1460904fd3c193ffaf809913b2983a400fce9d94.tar.xz
cdo-1460904fd3c193ffaf809913b2983a400fce9d94.zip
Fix line endings in master (dos2unix)
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.ui.location')
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.location/.settings/org.eclipse.core.resources.prefs6
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.location/copyright.txt14
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.location/plugin.properties22
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.location/src/org/eclipse/emf/cdo/ui/internal/location/NewRepositoryLocationDialog.java216
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.location/src/org/eclipse/emf/cdo/ui/internal/location/RepositoryLocationItemProvider.java188
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.location/src/org/eclipse/emf/cdo/ui/internal/location/RepositoryLocationsView.java214
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.location/src/org/eclipse/emf/cdo/ui/internal/location/bundle/OM.java104
7 files changed, 382 insertions, 382 deletions
diff --git a/plugins/org.eclipse.emf.cdo.ui.location/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.emf.cdo.ui.location/.settings/org.eclipse.core.resources.prefs
index 4edd72893e..4e4e9db3ed 100644
--- a/plugins/org.eclipse.emf.cdo.ui.location/.settings/org.eclipse.core.resources.prefs
+++ b/plugins/org.eclipse.emf.cdo.ui.location/.settings/org.eclipse.core.resources.prefs
@@ -1,3 +1,3 @@
-#Mon Jul 04 12:58:33 CEST 2011
-eclipse.preferences.version=1
-encoding//model/org.eclipse.emf.cdo.defs.ecorediag=UTF-8
+#Mon Jul 04 12:58:33 CEST 2011
+eclipse.preferences.version=1
+encoding//model/org.eclipse.emf.cdo.defs.ecorediag=UTF-8
diff --git a/plugins/org.eclipse.emf.cdo.ui.location/copyright.txt b/plugins/org.eclipse.emf.cdo.ui.location/copyright.txt
index 8f6328980e..0a0f67e6d7 100644
--- a/plugins/org.eclipse.emf.cdo.ui.location/copyright.txt
+++ b/plugins/org.eclipse.emf.cdo.ui.location/copyright.txt
@@ -1,8 +1,8 @@
-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:
+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 \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.cdo.ui.location/plugin.properties b/plugins/org.eclipse.emf.cdo.ui.location/plugin.properties
index fd55013425..6f9be68cd8 100644
--- a/plugins/org.eclipse.emf.cdo.ui.location/plugin.properties
+++ b/plugins/org.eclipse.emf.cdo.ui.location/plugin.properties
@@ -1,11 +1,11 @@
-# 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
-
-pluginName = CDO Model Repository Client UI Location
-providerName = Eclipse Modeling Project
+# 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
+
+pluginName = CDO Model Repository Client UI Location
+providerName = Eclipse Modeling Project
diff --git a/plugins/org.eclipse.emf.cdo.ui.location/src/org/eclipse/emf/cdo/ui/internal/location/NewRepositoryLocationDialog.java b/plugins/org.eclipse.emf.cdo.ui.location/src/org/eclipse/emf/cdo/ui/internal/location/NewRepositoryLocationDialog.java
index bf54675911..daf98a3db2 100644
--- a/plugins/org.eclipse.emf.cdo.ui.location/src/org/eclipse/emf/cdo/ui/internal/location/NewRepositoryLocationDialog.java
+++ b/plugins/org.eclipse.emf.cdo.ui.location/src/org/eclipse/emf/cdo/ui/internal/location/NewRepositoryLocationDialog.java
@@ -1,108 +1,108 @@
-/*
- * 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
- */
-package org.eclipse.emf.cdo.ui.internal.location;
-
-import org.eclipse.net4j.util.container.IManagedContainer;
-import org.eclipse.net4j.util.container.IPluginContainer;
-import org.eclipse.net4j.util.ui.container.ElementWizardComposite;
-
-import org.eclipse.jface.dialogs.TitleAreaDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * @author Eike Stepper
- */
-public class NewRepositoryLocationDialog extends TitleAreaDialog
-{
- private ElementWizardComposite connectorWizard;
-
- private Text repositoryNameText;
-
- private String connectorType;
-
- private String connectorDescription;
-
- private String repositoryName;
-
- public NewRepositoryLocationDialog(Shell parentShell)
- {
- super(parentShell);
- setShellStyle(getShellStyle() | SWT.APPLICATION_MODAL | SWT.MAX | SWT.TITLE | SWT.RESIZE);
- }
-
- public String getConnectorType()
- {
- return connectorType;
- }
-
- public String getConnectorDescription()
- {
- return connectorDescription;
- }
-
- public String getRepositoryName()
- {
- return repositoryName;
- }
-
- @Override
- protected void configureShell(Shell newShell)
- {
- super.configureShell(newShell);
- newShell.setText("New Repository Location");
- }
-
- @Override
- protected Control createDialogArea(Composite parent)
- {
- setTitle("New Repository Location");
- // setTitleImage(SharedIcons.getImage(SharedIcons.WIZBAN_PACKAGE_MANAGER));
-
- Composite composite = new Composite(parent, SWT.NONE);
- composite.setLayout(new GridLayout(1, false));
-
- Group group1 = new Group(composite, SWT.NONE);
- group1.setLayout(new GridLayout(1, false));
- group1.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1));
- group1.setText("Connection");
- connectorWizard = new ElementWizardComposite.WithRadios(group1, SWT.NONE, "org.eclipse.net4j.connectors", "Type:");
- connectorWizard.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
-
- Group group2 = new Group(composite, SWT.NONE);
- group2.setLayout(new GridLayout(1, false));
- group2.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1));
- group2.setText("Repository");
- repositoryNameText = new Text(group2, SWT.BORDER);
- repositoryNameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
- return composite;
- }
-
- protected IManagedContainer getContainer()
- {
- return IPluginContainer.INSTANCE;
- }
-
- @Override
- protected void okPressed()
- {
- connectorType = connectorWizard.getFactoryType();
- connectorDescription = connectorWizard.getDescription();
- repositoryName = repositoryNameText.getText();
- super.okPressed();
- }
-}
+/*
+ * 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
+ */
+package org.eclipse.emf.cdo.ui.internal.location;
+
+import org.eclipse.net4j.util.container.IManagedContainer;
+import org.eclipse.net4j.util.container.IPluginContainer;
+import org.eclipse.net4j.util.ui.container.ElementWizardComposite;
+
+import org.eclipse.jface.dialogs.TitleAreaDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * @author Eike Stepper
+ */
+public class NewRepositoryLocationDialog extends TitleAreaDialog
+{
+ private ElementWizardComposite connectorWizard;
+
+ private Text repositoryNameText;
+
+ private String connectorType;
+
+ private String connectorDescription;
+
+ private String repositoryName;
+
+ public NewRepositoryLocationDialog(Shell parentShell)
+ {
+ super(parentShell);
+ setShellStyle(getShellStyle() | SWT.APPLICATION_MODAL | SWT.MAX | SWT.TITLE | SWT.RESIZE);
+ }
+
+ public String getConnectorType()
+ {
+ return connectorType;
+ }
+
+ public String getConnectorDescription()
+ {
+ return connectorDescription;
+ }
+
+ public String getRepositoryName()
+ {
+ return repositoryName;
+ }
+
+ @Override
+ protected void configureShell(Shell newShell)
+ {
+ super.configureShell(newShell);
+ newShell.setText("New Repository Location");
+ }
+
+ @Override
+ protected Control createDialogArea(Composite parent)
+ {
+ setTitle("New Repository Location");
+ // setTitleImage(SharedIcons.getImage(SharedIcons.WIZBAN_PACKAGE_MANAGER));
+
+ Composite composite = new Composite(parent, SWT.NONE);
+ composite.setLayout(new GridLayout(1, false));
+
+ Group group1 = new Group(composite, SWT.NONE);
+ group1.setLayout(new GridLayout(1, false));
+ group1.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1));
+ group1.setText("Connection");
+ connectorWizard = new ElementWizardComposite.WithRadios(group1, SWT.NONE, "org.eclipse.net4j.connectors", "Type:");
+ connectorWizard.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
+
+ Group group2 = new Group(composite, SWT.NONE);
+ group2.setLayout(new GridLayout(1, false));
+ group2.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1));
+ group2.setText("Repository");
+ repositoryNameText = new Text(group2, SWT.BORDER);
+ repositoryNameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
+ return composite;
+ }
+
+ protected IManagedContainer getContainer()
+ {
+ return IPluginContainer.INSTANCE;
+ }
+
+ @Override
+ protected void okPressed()
+ {
+ connectorType = connectorWizard.getFactoryType();
+ connectorDescription = connectorWizard.getDescription();
+ repositoryName = repositoryNameText.getText();
+ super.okPressed();
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui.location/src/org/eclipse/emf/cdo/ui/internal/location/RepositoryLocationItemProvider.java b/plugins/org.eclipse.emf.cdo.ui.location/src/org/eclipse/emf/cdo/ui/internal/location/RepositoryLocationItemProvider.java
index 5a1255192e..7fb80079d0 100644
--- a/plugins/org.eclipse.emf.cdo.ui.location/src/org/eclipse/emf/cdo/ui/internal/location/RepositoryLocationItemProvider.java
+++ b/plugins/org.eclipse.emf.cdo.ui.location/src/org/eclipse/emf/cdo/ui/internal/location/RepositoryLocationItemProvider.java
@@ -1,94 +1,94 @@
-/*
- * 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
- */
-package org.eclipse.emf.cdo.ui.internal.location;
-
-import org.eclipse.emf.cdo.internal.location.BranchCheckoutSource;
-import org.eclipse.emf.cdo.location.IRepositoryLocation;
-import org.eclipse.emf.cdo.ui.shared.SharedIcons;
-
-import org.eclipse.net4j.util.container.IContainer;
-import org.eclipse.net4j.util.ui.actions.LongRunningAction;
-import org.eclipse.net4j.util.ui.views.ContainerItemProvider;
-import org.eclipse.net4j.util.ui.views.IElementFilter;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.viewers.ITreeSelection;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * @author Eike Stepper
- */
-public class RepositoryLocationItemProvider extends ContainerItemProvider<IContainer<Object>>
-{
- public RepositoryLocationItemProvider()
- {
- }
-
- public RepositoryLocationItemProvider(IElementFilter rootElementFilter)
- {
- super(rootElementFilter);
- }
-
- @Override
- public Image getImage(Object obj)
- {
- if (obj instanceof IRepositoryLocation)
- {
- return SharedIcons.getImage(SharedIcons.OBJ_REPO);
- }
-
- if (obj instanceof BranchCheckoutSource)
- {
- return SharedIcons.getImage(SharedIcons.OBJ_BRANCH);
- }
-
- return super.getImage(obj);
- }
-
- @Override
- protected void fillContextMenu(IMenuManager manager, ITreeSelection selection)
- {
- super.fillContextMenu(manager, selection);
- if (selection.size() == 1)
- {
- Object obj = selection.getFirstElement();
- if (obj instanceof IRepositoryLocation)
- {
- manager.add(new RemoveAction(obj));
- }
- }
- }
-
- /**
- * @author Eike Stepper
- */
- public static class RemoveAction extends LongRunningAction
- {
- private Object object;
-
- public RemoveAction(Object object)
- {
- super("Remove");
- this.object = object;
- }
-
- @Override
- protected void doRun(IProgressMonitor progressMonitor) throws Exception
- {
- if (object instanceof IRepositoryLocation)
- {
- IRepositoryLocation location = (IRepositoryLocation)object;
- location.delete();
- }
- }
- }
-}
+/*
+ * 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
+ */
+package org.eclipse.emf.cdo.ui.internal.location;
+
+import org.eclipse.emf.cdo.internal.location.BranchCheckoutSource;
+import org.eclipse.emf.cdo.location.IRepositoryLocation;
+import org.eclipse.emf.cdo.ui.shared.SharedIcons;
+
+import org.eclipse.net4j.util.container.IContainer;
+import org.eclipse.net4j.util.ui.actions.LongRunningAction;
+import org.eclipse.net4j.util.ui.views.ContainerItemProvider;
+import org.eclipse.net4j.util.ui.views.IElementFilter;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.viewers.ITreeSelection;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * @author Eike Stepper
+ */
+public class RepositoryLocationItemProvider extends ContainerItemProvider<IContainer<Object>>
+{
+ public RepositoryLocationItemProvider()
+ {
+ }
+
+ public RepositoryLocationItemProvider(IElementFilter rootElementFilter)
+ {
+ super(rootElementFilter);
+ }
+
+ @Override
+ public Image getImage(Object obj)
+ {
+ if (obj instanceof IRepositoryLocation)
+ {
+ return SharedIcons.getImage(SharedIcons.OBJ_REPO);
+ }
+
+ if (obj instanceof BranchCheckoutSource)
+ {
+ return SharedIcons.getImage(SharedIcons.OBJ_BRANCH);
+ }
+
+ return super.getImage(obj);
+ }
+
+ @Override
+ protected void fillContextMenu(IMenuManager manager, ITreeSelection selection)
+ {
+ super.fillContextMenu(manager, selection);
+ if (selection.size() == 1)
+ {
+ Object obj = selection.getFirstElement();
+ if (obj instanceof IRepositoryLocation)
+ {
+ manager.add(new RemoveAction(obj));
+ }
+ }
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ public static class RemoveAction extends LongRunningAction
+ {
+ private Object object;
+
+ public RemoveAction(Object object)
+ {
+ super("Remove");
+ this.object = object;
+ }
+
+ @Override
+ protected void doRun(IProgressMonitor progressMonitor) throws Exception
+ {
+ if (object instanceof IRepositoryLocation)
+ {
+ IRepositoryLocation location = (IRepositoryLocation)object;
+ location.delete();
+ }
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui.location/src/org/eclipse/emf/cdo/ui/internal/location/RepositoryLocationsView.java b/plugins/org.eclipse.emf.cdo.ui.location/src/org/eclipse/emf/cdo/ui/internal/location/RepositoryLocationsView.java
index b1903a86b6..0cc4bcbd1c 100644
--- a/plugins/org.eclipse.emf.cdo.ui.location/src/org/eclipse/emf/cdo/ui/internal/location/RepositoryLocationsView.java
+++ b/plugins/org.eclipse.emf.cdo.ui.location/src/org/eclipse/emf/cdo/ui/internal/location/RepositoryLocationsView.java
@@ -1,107 +1,107 @@
-/*
- * 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
- */
-package org.eclipse.emf.cdo.ui.internal.location;
-
-import org.eclipse.emf.cdo.location.IRepositoryLocationManager;
-import org.eclipse.emf.cdo.ui.internal.location.bundle.OM;
-
-import org.eclipse.net4j.util.container.IContainer;
-import org.eclipse.net4j.util.ui.views.ContainerItemProvider;
-import org.eclipse.net4j.util.ui.views.ContainerView;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.IWorkbenchActionConstants;
-
-/**
- * @author Eike Stepper
- */
-public class RepositoryLocationsView extends ContainerView
-{
- private NewLocationAction newAction;
-
- public RepositoryLocationsView()
- {
- }
-
- @Override
- protected IRepositoryLocationManager getContainer()
- {
- return IRepositoryLocationManager.INSTANCE;
- }
-
- @Override
- protected ContainerItemProvider<IContainer<Object>> createContainerItemProvider()
- {
- return new RepositoryLocationItemProvider();
- }
-
- @Override
- protected Control createUI(Composite parent)
- {
- newAction = new NewLocationAction();
- return super.createUI(parent);
- }
-
- @Override
- protected void fillLocalPullDown(IMenuManager manager)
- {
- manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- }
-
- @Override
- protected void fillLocalToolBar(IToolBarManager manager)
- {
- manager.add(newAction);
- manager.add(getRefreshAction());
- super.fillLocalToolBar(manager);
- }
-
- /**
- * @author Eike Stepper
- */
- private class NewLocationAction extends Action
- {
- public NewLocationAction()
- {
- setText("New Location");
- setToolTipText("Add a new repository location");
- setImageDescriptor(OM.getImageDescriptor("icons/add.gif"));
- }
-
- @Override
- public void run()
- {
- try
- {
- NewRepositoryLocationDialog dialog = new NewRepositoryLocationDialog(getSite().getShell());
- if (dialog.open() == NewRepositoryLocationDialog.OK)
- {
- String connectorType = dialog.getConnectorType();
- String connectorDescription = dialog.getConnectorDescription();
- String repositoryName = dialog.getRepositoryName();
-
- IRepositoryLocationManager.INSTANCE
- .addRepositoryLocation(connectorType, connectorDescription, repositoryName);
- }
- }
- catch (RuntimeException ex)
- {
- OM.LOG.error(ex);
- throw ex;
- }
- }
- }
-}
+/*
+ * 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
+ */
+package org.eclipse.emf.cdo.ui.internal.location;
+
+import org.eclipse.emf.cdo.location.IRepositoryLocationManager;
+import org.eclipse.emf.cdo.ui.internal.location.bundle.OM;
+
+import org.eclipse.net4j.util.container.IContainer;
+import org.eclipse.net4j.util.ui.views.ContainerItemProvider;
+import org.eclipse.net4j.util.ui.views.ContainerView;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.IWorkbenchActionConstants;
+
+/**
+ * @author Eike Stepper
+ */
+public class RepositoryLocationsView extends ContainerView
+{
+ private NewLocationAction newAction;
+
+ public RepositoryLocationsView()
+ {
+ }
+
+ @Override
+ protected IRepositoryLocationManager getContainer()
+ {
+ return IRepositoryLocationManager.INSTANCE;
+ }
+
+ @Override
+ protected ContainerItemProvider<IContainer<Object>> createContainerItemProvider()
+ {
+ return new RepositoryLocationItemProvider();
+ }
+
+ @Override
+ protected Control createUI(Composite parent)
+ {
+ newAction = new NewLocationAction();
+ return super.createUI(parent);
+ }
+
+ @Override
+ protected void fillLocalPullDown(IMenuManager manager)
+ {
+ manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ }
+
+ @Override
+ protected void fillLocalToolBar(IToolBarManager manager)
+ {
+ manager.add(newAction);
+ manager.add(getRefreshAction());
+ super.fillLocalToolBar(manager);
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ private class NewLocationAction extends Action
+ {
+ public NewLocationAction()
+ {
+ setText("New Location");
+ setToolTipText("Add a new repository location");
+ setImageDescriptor(OM.getImageDescriptor("icons/add.gif"));
+ }
+
+ @Override
+ public void run()
+ {
+ try
+ {
+ NewRepositoryLocationDialog dialog = new NewRepositoryLocationDialog(getSite().getShell());
+ if (dialog.open() == NewRepositoryLocationDialog.OK)
+ {
+ String connectorType = dialog.getConnectorType();
+ String connectorDescription = dialog.getConnectorDescription();
+ String repositoryName = dialog.getRepositoryName();
+
+ IRepositoryLocationManager.INSTANCE
+ .addRepositoryLocation(connectorType, connectorDescription, repositoryName);
+ }
+ }
+ catch (RuntimeException ex)
+ {
+ OM.LOG.error(ex);
+ throw ex;
+ }
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui.location/src/org/eclipse/emf/cdo/ui/internal/location/bundle/OM.java b/plugins/org.eclipse.emf.cdo.ui.location/src/org/eclipse/emf/cdo/ui/internal/location/bundle/OM.java
index 6e1ae7e93b..301b5efbab 100644
--- a/plugins/org.eclipse.emf.cdo.ui.location/src/org/eclipse/emf/cdo/ui/internal/location/bundle/OM.java
+++ b/plugins/org.eclipse.emf.cdo.ui.location/src/org/eclipse/emf/cdo/ui/internal/location/bundle/OM.java
@@ -1,52 +1,52 @@
-/*
- * 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.ui.internal.location.bundle;
-
-import org.eclipse.net4j.util.om.OMBundle;
-import org.eclipse.net4j.util.om.OMPlatform;
-import org.eclipse.net4j.util.om.log.OMLogger;
-import org.eclipse.net4j.util.om.trace.OMTracer;
-import org.eclipse.net4j.util.ui.UIActivator;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-
-/**
- * The <em>Operations & Maintenance</em> class of this bundle.
- *
- * @author Eike Stepper
- */
-public abstract class OM
-{
- public static final String BUNDLE_ID = "org.eclipse.emf.cdo.ui.location"; //$NON-NLS-1$
-
- public static final OMBundle BUNDLE = OMPlatform.INSTANCE.bundle(BUNDLE_ID, OM.class);
-
- public static final OMLogger LOG = BUNDLE.logger();
-
- public static final OMTracer DEBUG = BUNDLE.tracer("debug"); //$NON-NLS-1$
-
- public static ImageDescriptor getImageDescriptor(String imageFilePath)
- {
- return Activator.imageDescriptorFromPlugin(BUNDLE_ID, imageFilePath);
- }
-
- /**
- * @author Eike Stepper
- */
- public static final class Activator extends UIActivator
- {
- public Activator()
- {
- super(BUNDLE);
- }
- }
-}
+/*
+ * 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.ui.internal.location.bundle;
+
+import org.eclipse.net4j.util.om.OMBundle;
+import org.eclipse.net4j.util.om.OMPlatform;
+import org.eclipse.net4j.util.om.log.OMLogger;
+import org.eclipse.net4j.util.om.trace.OMTracer;
+import org.eclipse.net4j.util.ui.UIActivator;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+
+/**
+ * The <em>Operations & Maintenance</em> class of this bundle.
+ *
+ * @author Eike Stepper
+ */
+public abstract class OM
+{
+ public static final String BUNDLE_ID = "org.eclipse.emf.cdo.ui.location"; //$NON-NLS-1$
+
+ public static final OMBundle BUNDLE = OMPlatform.INSTANCE.bundle(BUNDLE_ID, OM.class);
+
+ public static final OMLogger LOG = BUNDLE.logger();
+
+ public static final OMTracer DEBUG = BUNDLE.tracer("debug"); //$NON-NLS-1$
+
+ public static ImageDescriptor getImageDescriptor(String imageFilePath)
+ {
+ return Activator.imageDescriptorFromPlugin(BUNDLE_ID, imageFilePath);
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ public static final class Activator extends UIActivator
+ {
+ public Activator()
+ {
+ super(BUNDLE);
+ }
+ }
+}

Back to the top