Skip to main content
aboutsummaryrefslogtreecommitdiffstats
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.workspace
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.workspace')
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.workspace/.settings/org.eclipse.core.resources.prefs6
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.workspace/copyright.txt14
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.workspace/plugin.properties22
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.workspace/plugin.xml90
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.workspace/src/org/eclipse/emf/cdo/ui/internal/workspace/CheckoutAction.java202
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.workspace/src/org/eclipse/emf/cdo/ui/internal/workspace/CheckoutAsAction.java74
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.workspace/src/org/eclipse/emf/cdo/ui/internal/workspace/CheckoutDialog.java254
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.workspace/src/org/eclipse/emf/cdo/ui/internal/workspace/WorkspacePropertyAdapterFactory.java80
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.workspace/src/org/eclipse/emf/cdo/ui/internal/workspace/bundle/OM.java104
9 files changed, 423 insertions, 423 deletions
diff --git a/plugins/org.eclipse.emf.cdo.ui.workspace/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.emf.cdo.ui.workspace/.settings/org.eclipse.core.resources.prefs
index 82219b3fe5..0762eb2194 100644
--- a/plugins/org.eclipse.emf.cdo.ui.workspace/.settings/org.eclipse.core.resources.prefs
+++ b/plugins/org.eclipse.emf.cdo.ui.workspace/.settings/org.eclipse.core.resources.prefs
@@ -1,3 +1,3 @@
-#Mon Jul 04 12:57:09 CEST 2011
-eclipse.preferences.version=1
-encoding//model/org.eclipse.emf.cdo.defs.ecorediag=UTF-8
+#Mon Jul 04 12:57:09 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.workspace/copyright.txt b/plugins/org.eclipse.emf.cdo.ui.workspace/copyright.txt
index 8f6328980e..0a0f67e6d7 100644
--- a/plugins/org.eclipse.emf.cdo.ui.workspace/copyright.txt
+++ b/plugins/org.eclipse.emf.cdo.ui.workspace/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.workspace/plugin.properties b/plugins/org.eclipse.emf.cdo.ui.workspace/plugin.properties
index 8a4271346d..f42cd62ad5 100644
--- a/plugins/org.eclipse.emf.cdo.ui.workspace/plugin.properties
+++ b/plugins/org.eclipse.emf.cdo.ui.workspace/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 Workspace
-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 Workspace
+providerName = Eclipse Modeling Project
diff --git a/plugins/org.eclipse.emf.cdo.ui.workspace/plugin.xml b/plugins/org.eclipse.emf.cdo.ui.workspace/plugin.xml
index b1e02c8e4c..e366c7d3d0 100644
--- a/plugins/org.eclipse.emf.cdo.ui.workspace/plugin.xml
+++ b/plugins/org.eclipse.emf.cdo.ui.workspace/plugin.xml
@@ -1,45 +1,45 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<!--
- 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
--->
-
-<plugin>
-
- <extension
- point="org.eclipse.ui.popupMenus">
- <objectContribution
- id="org.eclipse.emf.cdo.ui.workspace.CheckoutSourceContribution"
- objectClass="org.eclipse.emf.cdo.location.ICheckoutSource">
- <action
- class="org.eclipse.emf.cdo.ui.internal.workspace.CheckoutAsAction"
- enablesFor="1"
- id="org.eclipse.emf.cdo.ui.workspace.CheckoutAsAction"
- label="Check Out As...">
- </action>
- <action
- class="org.eclipse.emf.cdo.ui.internal.workspace.CheckoutAction"
- enablesFor="1"
- id="org.eclipse.emf.cdo.ui.workspace.CheckoutAction"
- label="Check Out">
- </action>
- </objectContribution>
- </extension>
-
- <extension
- point="org.eclipse.core.runtime.adapters">
- <factory
- adaptableType="org.eclipse.emf.cdo.workspace.CDOWorkspace"
- class="org.eclipse.emf.cdo.ui.internal.workspace.WorkspacePropertyAdapterFactory">
- <adapter type="org.eclipse.ui.views.properties.IPropertySourceProvider"/>
- </factory>
- </extension>
-
-</plugin>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<!--
+ 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
+-->
+
+<plugin>
+
+ <extension
+ point="org.eclipse.ui.popupMenus">
+ <objectContribution
+ id="org.eclipse.emf.cdo.ui.workspace.CheckoutSourceContribution"
+ objectClass="org.eclipse.emf.cdo.location.ICheckoutSource">
+ <action
+ class="org.eclipse.emf.cdo.ui.internal.workspace.CheckoutAsAction"
+ enablesFor="1"
+ id="org.eclipse.emf.cdo.ui.workspace.CheckoutAsAction"
+ label="Check Out As...">
+ </action>
+ <action
+ class="org.eclipse.emf.cdo.ui.internal.workspace.CheckoutAction"
+ enablesFor="1"
+ id="org.eclipse.emf.cdo.ui.workspace.CheckoutAction"
+ label="Check Out">
+ </action>
+ </objectContribution>
+ </extension>
+
+ <extension
+ point="org.eclipse.core.runtime.adapters">
+ <factory
+ adaptableType="org.eclipse.emf.cdo.workspace.CDOWorkspace"
+ class="org.eclipse.emf.cdo.ui.internal.workspace.WorkspacePropertyAdapterFactory">
+ <adapter type="org.eclipse.ui.views.properties.IPropertySourceProvider"/>
+ </factory>
+ </extension>
+
+</plugin>
diff --git a/plugins/org.eclipse.emf.cdo.ui.workspace/src/org/eclipse/emf/cdo/ui/internal/workspace/CheckoutAction.java b/plugins/org.eclipse.emf.cdo.ui.workspace/src/org/eclipse/emf/cdo/ui/internal/workspace/CheckoutAction.java
index db75750c92..4362d1bfa4 100644
--- a/plugins/org.eclipse.emf.cdo.ui.workspace/src/org/eclipse/emf/cdo/ui/internal/workspace/CheckoutAction.java
+++ b/plugins/org.eclipse.emf.cdo.ui.workspace/src/org/eclipse/emf/cdo/ui/internal/workspace/CheckoutAction.java
@@ -1,101 +1,101 @@
-/*
- * 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.workspace;
-
-import org.eclipse.emf.cdo.location.ICheckoutSource;
-import org.eclipse.emf.cdo.ui.internal.workspace.bundle.OM;
-import org.eclipse.emf.cdo.workspace.efs.CDOFS;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * @author Eike Stepper
- */
-public class CheckoutAction implements IObjectActionDelegate
-{
- private IWorkbenchPart part;
-
- private ISelection selection;
-
- public CheckoutAction()
- {
- }
-
- public void setActivePart(IAction action, IWorkbenchPart part)
- {
- this.part = part;
- }
-
- public IWorkbenchPart getPart()
- {
- return part;
- }
-
- public void selectionChanged(IAction action, ISelection selection)
- {
- this.selection = selection;
- }
-
- public ISelection getSelection()
- {
- return selection;
- }
-
- public void run(IAction action)
- {
- if (selection instanceof IStructuredSelection)
- {
- final Object element = ((IStructuredSelection)selection).getFirstElement();
- if (element instanceof ICheckoutSource)
- {
- ICheckoutSource checkoutSource = (ICheckoutSource)element;
- String projectName = checkoutSource.getRepositoryLocation().getRepositoryName();
- checkout(checkoutSource, projectName);
- }
- }
- }
-
- protected void checkout(final ICheckoutSource checkoutSource, final String projectName)
- {
- new Job("Checking out...")
- {
- @Override
- protected IStatus run(IProgressMonitor monitor)
- {
- try
- {
- CDOFS.checkout(checkoutSource, projectName, monitor);
- return Status.OK_STATUS;
- }
- catch (CoreException ex)
- {
- ex.printStackTrace();
- return ex.getStatus();
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- return new Status(IStatus.ERROR, OM.BUNDLE_ID, ex.getLocalizedMessage(), ex);
- }
- }
- }.schedule();
- }
-}
+/*
+ * 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.workspace;
+
+import org.eclipse.emf.cdo.location.ICheckoutSource;
+import org.eclipse.emf.cdo.ui.internal.workspace.bundle.OM;
+import org.eclipse.emf.cdo.workspace.efs.CDOFS;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+
+/**
+ * @author Eike Stepper
+ */
+public class CheckoutAction implements IObjectActionDelegate
+{
+ private IWorkbenchPart part;
+
+ private ISelection selection;
+
+ public CheckoutAction()
+ {
+ }
+
+ public void setActivePart(IAction action, IWorkbenchPart part)
+ {
+ this.part = part;
+ }
+
+ public IWorkbenchPart getPart()
+ {
+ return part;
+ }
+
+ public void selectionChanged(IAction action, ISelection selection)
+ {
+ this.selection = selection;
+ }
+
+ public ISelection getSelection()
+ {
+ return selection;
+ }
+
+ public void run(IAction action)
+ {
+ if (selection instanceof IStructuredSelection)
+ {
+ final Object element = ((IStructuredSelection)selection).getFirstElement();
+ if (element instanceof ICheckoutSource)
+ {
+ ICheckoutSource checkoutSource = (ICheckoutSource)element;
+ String projectName = checkoutSource.getRepositoryLocation().getRepositoryName();
+ checkout(checkoutSource, projectName);
+ }
+ }
+ }
+
+ protected void checkout(final ICheckoutSource checkoutSource, final String projectName)
+ {
+ new Job("Checking out...")
+ {
+ @Override
+ protected IStatus run(IProgressMonitor monitor)
+ {
+ try
+ {
+ CDOFS.checkout(checkoutSource, projectName, monitor);
+ return Status.OK_STATUS;
+ }
+ catch (CoreException ex)
+ {
+ ex.printStackTrace();
+ return ex.getStatus();
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+ return new Status(IStatus.ERROR, OM.BUNDLE_ID, ex.getLocalizedMessage(), ex);
+ }
+ }
+ }.schedule();
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui.workspace/src/org/eclipse/emf/cdo/ui/internal/workspace/CheckoutAsAction.java b/plugins/org.eclipse.emf.cdo.ui.workspace/src/org/eclipse/emf/cdo/ui/internal/workspace/CheckoutAsAction.java
index 239eb94a19..71713b2a99 100644
--- a/plugins/org.eclipse.emf.cdo.ui.workspace/src/org/eclipse/emf/cdo/ui/internal/workspace/CheckoutAsAction.java
+++ b/plugins/org.eclipse.emf.cdo.ui.workspace/src/org/eclipse/emf/cdo/ui/internal/workspace/CheckoutAsAction.java
@@ -1,37 +1,37 @@
-/*
- * 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.workspace;
-
-import org.eclipse.emf.cdo.location.ICheckoutSource;
-
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * @author Eike Stepper
- */
-public class CheckoutAsAction extends CheckoutAction
-{
- public CheckoutAsAction()
- {
- }
-
- @Override
- protected void checkout(ICheckoutSource checkoutSource, String projectName)
- {
- Shell shell = getPart().getSite().getShell();
- CheckoutDialog dialog = new CheckoutDialog(shell, projectName);
- if (dialog.open() == CheckoutDialog.OK)
- {
- super.checkout(checkoutSource, dialog.getProjectName());
- }
- }
-}
+/*
+ * 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.workspace;
+
+import org.eclipse.emf.cdo.location.ICheckoutSource;
+
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * @author Eike Stepper
+ */
+public class CheckoutAsAction extends CheckoutAction
+{
+ public CheckoutAsAction()
+ {
+ }
+
+ @Override
+ protected void checkout(ICheckoutSource checkoutSource, String projectName)
+ {
+ Shell shell = getPart().getSite().getShell();
+ CheckoutDialog dialog = new CheckoutDialog(shell, projectName);
+ if (dialog.open() == CheckoutDialog.OK)
+ {
+ super.checkout(checkoutSource, dialog.getProjectName());
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui.workspace/src/org/eclipse/emf/cdo/ui/internal/workspace/CheckoutDialog.java b/plugins/org.eclipse.emf.cdo.ui.workspace/src/org/eclipse/emf/cdo/ui/internal/workspace/CheckoutDialog.java
index 7fd53571cc..c517eff547 100644
--- a/plugins/org.eclipse.emf.cdo.ui.workspace/src/org/eclipse/emf/cdo/ui/internal/workspace/CheckoutDialog.java
+++ b/plugins/org.eclipse.emf.cdo.ui.workspace/src/org/eclipse/emf/cdo/ui/internal/workspace/CheckoutDialog.java
@@ -1,127 +1,127 @@
-/*
- * 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.workspace;
-
-import org.eclipse.net4j.util.container.IManagedContainer;
-import org.eclipse.net4j.util.container.IPluginContainer;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.dialogs.TitleAreaDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-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;
-
-import java.io.File;
-
-/**
- * @author Eike Stepper
- */
-public class CheckoutDialog extends TitleAreaDialog
-{
- private Text projectNameText;
-
- private String projectName;
-
- public CheckoutDialog(Shell parentShell, String projectName)
- {
- super(parentShell);
- setShellStyle(getShellStyle() | SWT.APPLICATION_MODAL | SWT.MAX | SWT.TITLE | SWT.RESIZE);
- this.projectName = projectName;
- }
-
- public String getProjectName()
- {
- return projectName;
- }
-
- @Override
- protected void configureShell(Shell newShell)
- {
- super.configureShell(newShell);
- newShell.setText("Check out");
- }
-
- @Override
- protected Control createDialogArea(Composite parent)
- {
- setTitle("Check out");
- // 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");
- projectNameText = new Text(group2, SWT.BORDER);
- projectNameText.setText(projectName == null ? "" : projectName);
- projectNameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
- projectNameText.addModifyListener(new ModifyListener()
- {
- public void modifyText(ModifyEvent e)
- {
- String projectName = projectNameText.getText();
- if (!Path.EMPTY.isValidSegment(projectName))
- {
- setErrorMessage("Invalid project name.");
- return;
- }
-
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
- if (project.exists())
- {
- setErrorMessage("Project name exists.");
- return;
- }
-
- if (new File(project.getLocation().toString()).exists())
- {
- setErrorMessage("Project location exists.");
- return;
- }
-
- setErrorMessage(null);
- }
- });
-
- return composite;
- }
-
- protected IManagedContainer getContainer()
- {
- return IPluginContainer.INSTANCE;
- }
-
- @Override
- protected void okPressed()
- {
- projectName = projectNameText.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.workspace;
+
+import org.eclipse.net4j.util.container.IManagedContainer;
+import org.eclipse.net4j.util.container.IPluginContainer;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.dialogs.TitleAreaDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+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;
+
+import java.io.File;
+
+/**
+ * @author Eike Stepper
+ */
+public class CheckoutDialog extends TitleAreaDialog
+{
+ private Text projectNameText;
+
+ private String projectName;
+
+ public CheckoutDialog(Shell parentShell, String projectName)
+ {
+ super(parentShell);
+ setShellStyle(getShellStyle() | SWT.APPLICATION_MODAL | SWT.MAX | SWT.TITLE | SWT.RESIZE);
+ this.projectName = projectName;
+ }
+
+ public String getProjectName()
+ {
+ return projectName;
+ }
+
+ @Override
+ protected void configureShell(Shell newShell)
+ {
+ super.configureShell(newShell);
+ newShell.setText("Check out");
+ }
+
+ @Override
+ protected Control createDialogArea(Composite parent)
+ {
+ setTitle("Check out");
+ // 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");
+ projectNameText = new Text(group2, SWT.BORDER);
+ projectNameText.setText(projectName == null ? "" : projectName);
+ projectNameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
+ projectNameText.addModifyListener(new ModifyListener()
+ {
+ public void modifyText(ModifyEvent e)
+ {
+ String projectName = projectNameText.getText();
+ if (!Path.EMPTY.isValidSegment(projectName))
+ {
+ setErrorMessage("Invalid project name.");
+ return;
+ }
+
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
+ if (project.exists())
+ {
+ setErrorMessage("Project name exists.");
+ return;
+ }
+
+ if (new File(project.getLocation().toString()).exists())
+ {
+ setErrorMessage("Project location exists.");
+ return;
+ }
+
+ setErrorMessage(null);
+ }
+ });
+
+ return composite;
+ }
+
+ protected IManagedContainer getContainer()
+ {
+ return IPluginContainer.INSTANCE;
+ }
+
+ @Override
+ protected void okPressed()
+ {
+ projectName = projectNameText.getText();
+ super.okPressed();
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui.workspace/src/org/eclipse/emf/cdo/ui/internal/workspace/WorkspacePropertyAdapterFactory.java b/plugins/org.eclipse.emf.cdo.ui.workspace/src/org/eclipse/emf/cdo/ui/internal/workspace/WorkspacePropertyAdapterFactory.java
index e771835712..b4dcb862c1 100644
--- a/plugins/org.eclipse.emf.cdo.ui.workspace/src/org/eclipse/emf/cdo/ui/internal/workspace/WorkspacePropertyAdapterFactory.java
+++ b/plugins/org.eclipse.emf.cdo.ui.workspace/src/org/eclipse/emf/cdo/ui/internal/workspace/WorkspacePropertyAdapterFactory.java
@@ -1,40 +1,40 @@
-/*
- * 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.workspace;
-
-import org.eclipse.emf.cdo.internal.workspace.WorkspaceProperties;
-import org.eclipse.emf.cdo.workspace.CDOWorkspace;
-
-import org.eclipse.net4j.util.ui.AbstractPropertyAdapterFactory;
-import org.eclipse.net4j.util.ui.DefaultPropertySource;
-
-import org.eclipse.ui.views.properties.IPropertySource;
-
-/**
- * @author Eike Stepper
- */
-public class WorkspacePropertyAdapterFactory extends AbstractPropertyAdapterFactory
-{
- public WorkspacePropertyAdapterFactory()
- {
- }
-
- @Override
- protected IPropertySource createPropertySource(Object object)
- {
- if (object instanceof CDOWorkspace)
- {
- return new DefaultPropertySource<CDOWorkspace>((CDOWorkspace)object, WorkspaceProperties.INSTANCE);
- }
-
- return null;
- }
-}
+/*
+ * 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.workspace;
+
+import org.eclipse.emf.cdo.internal.workspace.WorkspaceProperties;
+import org.eclipse.emf.cdo.workspace.CDOWorkspace;
+
+import org.eclipse.net4j.util.ui.AbstractPropertyAdapterFactory;
+import org.eclipse.net4j.util.ui.DefaultPropertySource;
+
+import org.eclipse.ui.views.properties.IPropertySource;
+
+/**
+ * @author Eike Stepper
+ */
+public class WorkspacePropertyAdapterFactory extends AbstractPropertyAdapterFactory
+{
+ public WorkspacePropertyAdapterFactory()
+ {
+ }
+
+ @Override
+ protected IPropertySource createPropertySource(Object object)
+ {
+ if (object instanceof CDOWorkspace)
+ {
+ return new DefaultPropertySource<CDOWorkspace>((CDOWorkspace)object, WorkspaceProperties.INSTANCE);
+ }
+
+ return null;
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui.workspace/src/org/eclipse/emf/cdo/ui/internal/workspace/bundle/OM.java b/plugins/org.eclipse.emf.cdo.ui.workspace/src/org/eclipse/emf/cdo/ui/internal/workspace/bundle/OM.java
index 03c70f382a..9f04ccf0b4 100644
--- a/plugins/org.eclipse.emf.cdo.ui.workspace/src/org/eclipse/emf/cdo/ui/internal/workspace/bundle/OM.java
+++ b/plugins/org.eclipse.emf.cdo.ui.workspace/src/org/eclipse/emf/cdo/ui/internal/workspace/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.workspace.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.workspace"; //$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.workspace.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.workspace"; //$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