Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2015-02-18 06:41:24 -0500
committerEike Stepper2015-02-18 09:27:28 -0500
commit48eb493ae877d216fec484225233a32088af2e85 (patch)
treea8c0bb5fd9fc96c19bb20683d74578c4527d380d
parenteab1e33539d9ead39318c455b7b580a4ba407391 (diff)
downloadcdo-committers/estepper/papyrus2.tar.gz
cdo-committers/estepper/papyrus2.tar.xz
cdo-committers/estepper/papyrus2.zip
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=458349
-rw-r--r--plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/CDOCheckoutContentProvider.java23
-rw-r--r--plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/CDOCheckoutNewActionProvider.java146
-rw-r--r--plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/handlers/RepositoryDeleteHandler.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/handlers/WorkspaceRevertHandler.java17
-rw-r--r--plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/AbstractRepositoryPage.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/RepositoryLocalPage.java88
-rw-r--r--plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/RepositoryTypePage.java12
-rw-r--r--plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/explorer/CDOExplorerUtil.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/repositories/LocalCDORepository.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.workspace/src/org/eclipse/emf/cdo/internal/workspace/FolderCDOWorkspaceBase.java5
10 files changed, 251 insertions, 52 deletions
diff --git a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/CDOCheckoutContentProvider.java b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/CDOCheckoutContentProvider.java
index bb27c5ee58..40488a48da 100644
--- a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/CDOCheckoutContentProvider.java
+++ b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/CDOCheckoutContentProvider.java
@@ -78,8 +78,10 @@ import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
/**
@@ -87,6 +89,8 @@ import java.util.concurrent.ConcurrentHashMap;
*/
public class CDOCheckoutContentProvider extends AdapterFactoryContentProvider implements IOpenListener
{
+ private static final Set<Object> LOADING_OBJECTS = new HashSet<Object>();
+
private static final Method GET_CHILDREN_FEATURES_METHOD = getMethod(ItemProviderAdapter.class,
"getChildrenFeatures", Object.class);
@@ -369,6 +373,11 @@ public class CDOCheckoutContentProvider extends AdapterFactoryContentProvider im
final Object finalObject = object;
final CDOCheckout finalOpeningCheckout = openingCheckout;
+ synchronized (LOADING_OBJECTS)
+ {
+ LOADING_OBJECTS.add(originalObject);
+ }
+
new Job("Load " + finalObject)
{
@Override
@@ -434,6 +443,12 @@ public class CDOCheckoutContentProvider extends AdapterFactoryContentProvider im
// The viewer must be refreshed synchronously so that the loaded children don't get garbage collected.
ViewerUtil.refresh(viewer, originalObject, false);
+
+ synchronized (LOADING_OBJECTS)
+ {
+ LOADING_OBJECTS.remove(originalObject);
+ }
+
return Status.OK_STATUS;
}
}.schedule();
@@ -740,4 +755,12 @@ public class CDOCheckoutContentProvider extends AdapterFactoryContentProvider im
return null;
}
}
+
+ public static boolean isObjectLoading(Object object)
+ {
+ synchronized (LOADING_OBJECTS)
+ {
+ return LOADING_OBJECTS.contains(object);
+ }
+ }
}
diff --git a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/CDOCheckoutNewActionProvider.java b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/CDOCheckoutNewActionProvider.java
index 053752e4c2..1fd0b961be 100644
--- a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/CDOCheckoutNewActionProvider.java
+++ b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/CDOCheckoutNewActionProvider.java
@@ -21,11 +21,13 @@ import org.eclipse.emf.cdo.internal.ui.editor.CDOEditor;
import org.eclipse.emf.cdo.internal.ui.editor.CDOEditor.NewRootMenuPopulator;
import org.eclipse.emf.cdo.transaction.CDOTransaction;
import org.eclipse.emf.cdo.util.CDOUtil;
+import org.eclipse.emf.cdo.view.CDOView;
import org.eclipse.emf.common.command.BasicCommandStack;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.edit.command.CommandParameter;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
@@ -45,7 +47,9 @@ import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
@@ -58,6 +62,7 @@ import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite;
import org.eclipse.ui.navigator.WizardActionGroup;
import java.util.Collection;
+import java.util.LinkedList;
/**
* @author Eike Stepper
@@ -74,7 +79,7 @@ public class CDOCheckoutNewActionProvider extends CommonActionProvider implement
private IWorkbenchPage page;
- private StructuredViewer viewer;
+ private TreeViewer viewer;
private Object selectedObject;
@@ -97,7 +102,7 @@ public class CDOCheckoutNewActionProvider extends CommonActionProvider implement
newWizardActionGroup = new WizardActionGroup(window, PlatformUI.getWorkbench().getNewWizardRegistry(),
WizardActionGroup.TYPE_NEW, extensionSite.getContentService());
- viewer = extensionSite.getStructuredViewer();
+ viewer = (TreeViewer)extensionSite.getStructuredViewer();
viewer.addSelectionChangedListener(this);
updateSelectedObject(viewer.getSelection());
}
@@ -233,77 +238,158 @@ public class CDOCheckoutNewActionProvider extends CommonActionProvider implement
}
}
+ private void selectObject(final EObject object)
+ {
+ viewer.getControl().getDisplay().asyncExec(new Runnable()
+ {
+ public void run()
+ {
+ LinkedList<EObject> path = new LinkedList<EObject>();
+ CDOCheckout checkout = CDOExplorerUtil.walkUp(object, path);
+ if (checkout != null)
+ {
+ viewer.setExpandedState(checkout, true);
+
+ path.removeFirst();
+ path.removeLast();
+
+ for (EObject object : path)
+ {
+ viewer.setExpandedState(object, true);
+ }
+
+ final Control control = viewer.getControl();
+ final Display display = control.getDisplay();
+ final long end = System.currentTimeMillis() + 1000L;
+
+ display.asyncExec(new Runnable()
+ {
+ public void run()
+ {
+ if (control.isDisposed())
+ {
+ return;
+ }
+
+ viewer.setSelection(new StructuredSelection(object), true);
+ if (viewer.getSelection().isEmpty())
+ {
+ if (CDOCheckoutContentProvider.isObjectLoading(object) || System.currentTimeMillis() < end)
+ {
+ display.timerExec(50, this);
+ }
+ }
+ }
+ });
+ }
+ }
+ });
+ }
+
/**
* @author Eike Stepper
*/
- private class NewRootAction extends TransactionalBackgroundAction
+ private abstract class AbstractNewAction extends TransactionalBackgroundAction
{
- private final EObject object;
+ private EObject newObject;
- public NewRootAction(CDOResource resource, EObject object)
+ public AbstractNewAction(String text, String toolTipText, ImageDescriptor image, CDOObject parent)
{
- super(page, object.eClass().getName(), null, ExtendedImageRegistry.getInstance().getImageDescriptor(
- CDOEditor.getLabelImage(adapterFactory, object)), resource);
- this.object = object;
+ super(page, text, toolTipText, image, parent);
}
@Override
- protected CDOTransaction openTransaction(CDOObject object)
+ protected CDOTransaction openTransaction(CDOObject AbstractNewAction)
{
- CDOCheckout checkout = CDOExplorerUtil.getCheckout(object);
+ CDOCheckout checkout = CDOExplorerUtil.getCheckout(AbstractNewAction);
if (checkout != null)
{
return checkout.openTransaction();
}
-
+
return null;
}
@Override
- protected void doRun(CDOTransaction transaction, CDOObject resource, IProgressMonitor monitor) throws Exception
+ protected final void doRun(CDOTransaction transaction, CDOObject parent, IProgressMonitor monitor) throws Exception
+ {
+ newObject = doRun(transaction, parent, new StructuredSelection(parent));
+ }
+
+ protected abstract EObject doRun(CDOTransaction transaction, CDOObject parent, ISelection selection);
+
+ @Override
+ protected void postRun(CDOView view, CDOObject parent)
+ {
+ if (newObject != null)
+ {
+ EObject object = view.getObject(newObject);
+ if (object != null)
+ {
+ selectObject(object);
+ }
+ }
+ }
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ private class NewRootAction extends AbstractNewAction
+ {
+ private final EObject object;
+
+ public NewRootAction(CDOResource resource, EObject object)
+ {
+ super(object.eClass().getName(), null, ExtendedImageRegistry.getInstance().getImageDescriptor(
+ CDOEditor.getLabelImage(adapterFactory, object)), resource);
+ this.object = object;
+ }
+
+ @Override
+ protected EObject doRun(CDOTransaction transaction, CDOObject resource, ISelection selection)
{
EList<EObject> contents = ((CDOResource)resource).getContents();
contents.add(object);
+ return object;
}
}
/**
* @author Eike Stepper
*/
- private class NewChildAction extends TransactionalBackgroundAction
+ private class NewChildAction extends AbstractNewAction
{
private final Object childDescriptor;
public NewChildAction(String text, String toolTipText, ImageDescriptor image, CDOObject parent,
Object childDescriptor)
{
- super(page, text, toolTipText, image, parent);
+ super(text, toolTipText, image, parent);
this.childDescriptor = childDescriptor;
}
@Override
- protected CDOTransaction openTransaction(CDOObject object)
- {
- CDOCheckout checkout = CDOExplorerUtil.getCheckout(object);
- if (checkout != null)
- {
- return checkout.openTransaction();
- }
-
- return null;
- }
-
- @Override
- protected void doRun(CDOTransaction transaction, CDOObject parent, IProgressMonitor monitor) throws Exception
+ protected EObject doRun(CDOTransaction transaction, CDOObject parent, ISelection selection)
{
BasicCommandStack commandStack = new BasicCommandStack();
ResourceSet resourceSet = transaction.getResourceSet();
EditingDomain editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, resourceSet);
- IStructuredSelection selection = new StructuredSelection(parent);
-
CreateChildAction delegate = new CreateChildAction(editingDomain, selection, childDescriptor);
delegate.run();
+
+ if (childDescriptor instanceof CommandParameter)
+ {
+ CommandParameter parameter = (CommandParameter)childDescriptor;
+ Object value = parameter.getValue();
+ if (value instanceof EObject)
+ {
+ return (EObject)value;
+ }
+ }
+
+ return null;
}
}
}
diff --git a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/handlers/RepositoryDeleteHandler.java b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/handlers/RepositoryDeleteHandler.java
index 78658810e2..f6f1df816d 100644
--- a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/handlers/RepositoryDeleteHandler.java
+++ b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/handlers/RepositoryDeleteHandler.java
@@ -61,8 +61,9 @@ public class RepositoryDeleteHandler extends AbstractRepositoryHandler
{
String plural = size == 1 ? "" : "s";
String message = size == 1 ? "is 1" : "are " + size;
+
if (MessageDialog.openQuestion(shell, "Existing Checkouts", "There " + message + " existing checkout" + plural
- + ".\n\n" + "Are you sure you want to delete the existing checkout" + plural + ", too?"))
+ + ".\n\n" + "Are you sure you want to delete the checkout" + plural + ", too?"))
{
DeleteElementsDialog dialog = new DeleteElementsDialog(shell, checkouts.toArray(new AbstractElement[size]));
if (dialog.open() == DeleteElementsDialog.OK)
diff --git a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/handlers/WorkspaceRevertHandler.java b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/handlers/WorkspaceRevertHandler.java
index ac2c6275e7..69ee6859c7 100644
--- a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/handlers/WorkspaceRevertHandler.java
+++ b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/handlers/WorkspaceRevertHandler.java
@@ -25,6 +25,7 @@ import org.eclipse.emf.spi.cdo.InternalCDOView;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.TreeViewer;
@@ -86,6 +87,22 @@ public class WorkspaceRevertHandler extends AbstractBaseHandler<OfflineCDOChecko
}
Shell shell = HandlerUtil.getActiveShell(event);
+
+ int size = dirtyTransactions.size();
+ if (size != 0)
+ {
+ String plural = size == 1 ? "" : "s";
+ String message = size == 1 ? "is 1" : "are " + size;
+
+ if (!MessageDialog.openQuestion(shell, "Uncommitted Transaction" + plural, "There " + message
+ + " uncommitted transaction" + plural + ".\n\n" + "Are you sure you want to rollback the transaction"
+ + plural + ", too?"))
+ {
+ cancel();
+ return;
+ }
+ }
+
OfflineCDOCheckout checkout = elements.get(0);
CDOChangeSetData revertData = workspace.getLocalChanges(false);
diff --git a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/AbstractRepositoryPage.java b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/AbstractRepositoryPage.java
index a38843c1ca..ddca579a5a 100644
--- a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/AbstractRepositoryPage.java
+++ b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/AbstractRepositoryPage.java
@@ -100,7 +100,7 @@ public abstract class AbstractRepositoryPage extends WizardPage implements Selec
protected final void validate()
{
properties = new Properties();
- properties.put(CDORepositoryImpl.PROP_NAME, getName());
+ properties.put(CDORepositoryImpl.PROP_TYPE, getName());
try
{
diff --git a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/RepositoryLocalPage.java b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/RepositoryLocalPage.java
index 4d840a6978..19cd076f68 100644
--- a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/RepositoryLocalPage.java
+++ b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/RepositoryLocalPage.java
@@ -10,11 +10,15 @@
*/
package org.eclipse.emf.cdo.explorer.ui.repositories.wizards;
+import org.eclipse.emf.cdo.explorer.CDOExplorerUtil;
+import org.eclipse.emf.cdo.explorer.repositories.CDORepository;
+import org.eclipse.emf.cdo.explorer.repositories.CDORepositoryManager;
import org.eclipse.emf.cdo.internal.explorer.repositories.LocalCDORepository;
import org.eclipse.emf.cdo.internal.explorer.repositories.LocalCDORepository.IDGeneration;
import org.eclipse.emf.cdo.internal.explorer.repositories.LocalCDORepository.VersioningMode;
import org.eclipse.net4j.util.StringUtil;
+import org.eclipse.net4j.util.io.IOUtil;
import org.eclipse.net4j.util.ui.widgets.TextAndDisable;
import org.eclipse.swt.SWT;
@@ -26,13 +30,19 @@ import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.HashSet;
import java.util.Properties;
+import java.util.Set;
/**
* @author Eike Stepper
*/
public class RepositoryLocalPage extends AbstractRepositoryPage
{
+ private final Set<Integer> configuredPorts = new HashSet<Integer>();
+
private Text nameText;
private Button normalButton;
@@ -52,6 +62,28 @@ public class RepositoryLocalPage extends AbstractRepositoryPage
super("local", "Local Repository 1");
setTitle("New Local Repository");
setMessage("Enter the label and the connection parameters of the new remote location.");
+
+ CDORepositoryManager repositoryManager = CDOExplorerUtil.getRepositoryManager();
+ for (CDORepository repository : repositoryManager.getRepositories())
+ {
+ try
+ {
+ URI uri = new URI(repository.getURI());
+ if ("tcp".equals(uri.getScheme()))
+ {
+ String host = uri.getHost();
+ if ("localhost".equals(host) || "127.0.0.1".equals(host))
+ {
+ configuredPorts.add(uri.getPort());
+ }
+ }
+ }
+ catch (URISyntaxException ex)
+ {
+ //$FALL-THROUGH$
+ }
+ }
+
}
@Override
@@ -79,7 +111,6 @@ public class RepositoryLocalPage extends AbstractRepositoryPage
normalButton = new Button(modeGroup, SWT.RADIO);
normalButton.setText("Normal (no history)");
- normalButton.setSelection(true);
normalButton.addSelectionListener(this);
auditingButton = new Button(modeGroup, SWT.RADIO);
@@ -88,6 +119,7 @@ public class RepositoryLocalPage extends AbstractRepositoryPage
branchingButton = new Button(modeGroup, SWT.RADIO);
branchingButton.setText("Branching (history tree)");
+ branchingButton.setSelection(true);
branchingButton.addSelectionListener(this);
Group idGroup = new Group(composite, SWT.NONE);
@@ -97,17 +129,17 @@ public class RepositoryLocalPage extends AbstractRepositoryPage
counterButton = new Button(idGroup, SWT.RADIO);
counterButton.setText("Counter (efficient)");
- counterButton.setSelection(true);
counterButton.addSelectionListener(this);
uuidButton = new Button(idGroup, SWT.RADIO);
uuidButton.setText("UUID (replicable)");
+ uuidButton.setSelection(true);
uuidButton.addSelectionListener(this);
createLabel(container, "TCP port:");
portText = new TextAndDisable(container, SWT.BORDER, null);
portText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
- portText.setValue("2037");
+ portText.setValue(Integer.toString(getDefaultPort()));
portText.setDisabled(true);
portText.addModifyListener(this);
portText.addSelectionListener(this);
@@ -148,23 +180,55 @@ public class RepositoryLocalPage extends AbstractRepositoryPage
properties.put(LocalCDORepository.PROP_ID_GENERATION, IDGeneration.UUID.toString());
}
- String port = portText.getValue();
+ boolean tcpPortDisabled = portText.isDisabled();
+ properties.put(LocalCDORepository.PROP_TCP_DISABLED, Boolean.toString(tcpPortDisabled));
- try
+ if (!tcpPortDisabled)
{
- int value = Integer.parseInt(port);
- if (value < 0)
+ int port;
+
+ try
+ {
+ port = Integer.parseInt(portText.getValue());
+ if (port < 0 || port > 0xffff)
+ {
+ throw new Exception();
+ }
+ }
+ catch (Exception ex)
+ {
+ throw new Exception("Invalid TCP port.");
+ }
+
+ if (!isFreePort(port))
{
- throw new Exception();
+ throw new Exception("TCP port " + port + " is not available.");
}
+
+ properties.put(LocalCDORepository.PROP_TCP_PORT, port);
}
- catch (Exception ex)
+ }
+
+ private int getDefaultPort()
+ {
+ for (int port = 2036; port < 0xffff; port++)
{
- throw new Exception("Invalid TCP port.");
+ if (isFreePort(port))
+ {
+ return port;
+ }
}
- properties.put(LocalCDORepository.PROP_TCP_DISABLED, Boolean.toString(portText.isDisabled()));
- properties.put(LocalCDORepository.PROP_TCP_PORT, port);
+ return 2036;
+ }
+
+ private boolean isFreePort(int port)
+ {
+ if (configuredPorts.contains(port))
+ {
+ return false;
+ }
+ return IOUtil.isFreePort(port);
}
}
diff --git a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/RepositoryTypePage.java b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/RepositoryTypePage.java
index e9934efd16..db9b1fd6db 100644
--- a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/RepositoryTypePage.java
+++ b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/RepositoryTypePage.java
@@ -54,23 +54,26 @@ public class RepositoryTypePage extends WizardPage
NewRepositoryWizard wizard = getWizard();
RepositoryRemotePage remotePage = wizard.getRemotePage();
- addChoice(composite, "Connect to an existing remote repository.", "icons/wiz/repo_remote.gif", remotePage);
+ addChoice(composite, "Connect to an existing remote repository.", "icons/wiz/repo_remote.gif", remotePage, true);
RepositoryClonePage clonePage = wizard.getClonePage();
- addChoice(composite, "Clone an existing remote repository.", "icons/wiz/repo_clone.gif", clonePage);
+ addChoice(composite, "Clone an existing remote repository.", "icons/wiz/repo_clone.gif", clonePage, false);
RepositoryLocalPage localPage = wizard.getLocalPage();
- addChoice(composite, "Create a new local repository.", "icons/wiz/repo_local.gif", localPage);
+ addChoice(composite, "Create a new local repository.", "icons/wiz/repo_local.gif", localPage, true);
nextPage = remotePage;
setPageComplete(true);
}
- private Button addChoice(Composite composite, String text, String imagePath, final AbstractRepositoryPage nextPage)
+ private Button addChoice(Composite composite, String text, String imagePath, final AbstractRepositoryPage nextPage,
+ boolean enabled)
{
this.nextPage = nextPage;
+
Button button = new Button(composite, SWT.RADIO);
button.setText(text);
+ button.setEnabled(enabled);
button.addSelectionListener(new SelectionListener()
{
public void widgetSelected(SelectionEvent e)
@@ -97,6 +100,7 @@ public class RepositoryTypePage extends WizardPage
Label imageLabel = new Label(composite, SWT.NONE);
imageLabel.setImage(OM.getImage(imagePath));
+ imageLabel.setEnabled(enabled);
new Label(composite, SWT.NONE);
return button;
diff --git a/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/explorer/CDOExplorerUtil.java b/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/explorer/CDOExplorerUtil.java
index bdf1a56d28..575230398d 100644
--- a/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/explorer/CDOExplorerUtil.java
+++ b/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/explorer/CDOExplorerUtil.java
@@ -92,7 +92,7 @@ public final class CDOExplorerUtil
return null;
}
- private static CDOCheckout walkUp(EObject object, LinkedList<EObject> path)
+ public static CDOCheckout walkUp(EObject object, LinkedList<EObject> path)
{
while (object != null)
{
diff --git a/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/repositories/LocalCDORepository.java b/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/repositories/LocalCDORepository.java
index 5bf945a44b..7307be6288 100644
--- a/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/repositories/LocalCDORepository.java
+++ b/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/repositories/LocalCDORepository.java
@@ -109,7 +109,10 @@ public class LocalCDORepository extends CDORepositoryImpl
versioningMode = VersioningMode.valueOf(properties.getProperty(PROP_VERSIONING_MODE));
idGeneration = IDGeneration.valueOf(properties.getProperty(PROP_ID_GENERATION));
tcpDisabled = Boolean.parseBoolean(properties.getProperty(PROP_TCP_DISABLED));
- tcpPort = Integer.parseInt(properties.getProperty(PROP_TCP_PORT));
+ if (!tcpDisabled)
+ {
+ tcpPort = Integer.parseInt(properties.getProperty(PROP_TCP_PORT));
+ }
}
@Override
diff --git a/plugins/org.eclipse.emf.cdo.workspace/src/org/eclipse/emf/cdo/internal/workspace/FolderCDOWorkspaceBase.java b/plugins/org.eclipse.emf.cdo.workspace/src/org/eclipse/emf/cdo/internal/workspace/FolderCDOWorkspaceBase.java
index 90b4e8ec1e..987fb1f349 100644
--- a/plugins/org.eclipse.emf.cdo.workspace/src/org/eclipse/emf/cdo/internal/workspace/FolderCDOWorkspaceBase.java
+++ b/plugins/org.eclipse.emf.cdo.workspace/src/org/eclipse/emf/cdo/internal/workspace/FolderCDOWorkspaceBase.java
@@ -23,6 +23,7 @@ import org.eclipse.emf.cdo.spi.workspace.InternalCDOWorkspaceBase;
import org.eclipse.emf.cdo.workspace.CDOWorkspaceBase;
import org.eclipse.emf.cdo.workspace.CDOWorkspaceUtil;
+import org.eclipse.net4j.util.ObjectUtil;
import org.eclipse.net4j.util.factory.ProductCreationException;
import org.eclipse.net4j.util.io.ExtendedDataInputStream;
import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
@@ -169,7 +170,7 @@ public class FolderCDOWorkspaceBase extends AbstractCDOWorkspaceBase
writer.write(key);
writer.write("\t");
writer.write(Integer.toString(detachedVersion));
- writer.write("\t");
+ writer.write("\n");
}
catch (IOException ex)
{
@@ -315,7 +316,7 @@ public class FolderCDOWorkspaceBase extends AbstractCDOWorkspaceBase
{
for (File file : files)
{
- if (file.isFile())
+ if (!ObjectUtil.equals(file, addedAndDetachedFile))
{
CDOID id = getCDOID(file.getName());
ids.add(id);

Back to the top