diff options
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse')
30 files changed, 1733 insertions, 1733 deletions
diff --git a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/DawnRuntimePlugin.java b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/DawnRuntimePlugin.java index 481f7e52f2..daf4029433 100644 --- a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/DawnRuntimePlugin.java +++ b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/DawnRuntimePlugin.java @@ -1,44 +1,44 @@ -/*
- * 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:
- * Martin Fluegge - initial API and implementation
- */
-package org.eclipse.emf.cdo.dawn;
-
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-import org.osgi.framework.BundleContext;
-
-/**
- * @author Martin Fluegge
- */
-public class DawnRuntimePlugin extends AbstractUIPlugin
-{
- public static final String PLUGIN_ID = "org.eclipse.emf.cdo.dawn";
-
- private static DawnRuntimePlugin plugin;
-
- @Override
- public void start(BundleContext context) throws Exception
- {
- super.start(context);
- plugin = this;
- }
-
- @Override
- public void stop(BundleContext context) throws Exception
- {
- plugin = null;
- super.stop(context);
- }
-
- public static DawnRuntimePlugin getDefault()
- {
- return plugin;
- }
-}
+/* + * 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: + * Martin Fluegge - initial API and implementation + */ +package org.eclipse.emf.cdo.dawn; + +import org.eclipse.ui.plugin.AbstractUIPlugin; + +import org.osgi.framework.BundleContext; + +/** + * @author Martin Fluegge + */ +public class DawnRuntimePlugin extends AbstractUIPlugin +{ + public static final String PLUGIN_ID = "org.eclipse.emf.cdo.dawn"; + + private static DawnRuntimePlugin plugin; + + @Override + public void start(BundleContext context) throws Exception + { + super.start(context); + plugin = this; + } + + @Override + public void stop(BundleContext context) throws Exception + { + plugin = null; + super.stop(context); + } + + public static DawnRuntimePlugin getDefault() + { + return plugin; + } +} diff --git a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/actions/HandleConflictsAction.java b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/actions/HandleConflictsAction.java index 5518b0a3d4..076a01df2a 100644 --- a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/actions/HandleConflictsAction.java +++ b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/actions/HandleConflictsAction.java @@ -1,87 +1,87 @@ -/*
- * 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:
- * Martin Fluegge - initial API and implementation
- */
-package org.eclipse.emf.cdo.dawn.actions;
-
-import org.eclipse.emf.cdo.dawn.editors.IDawnEditor;
-import org.eclipse.emf.cdo.dawn.helper.DawnEditorHelper;
-import org.eclipse.emf.cdo.internal.dawn.bundle.OM;
-
-import org.eclipse.net4j.util.om.trace.ContextTracer;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * Since Dawn 0.2 this class is deprecated and replaced with "org.eclipse.emf.cdo.dawn.handlers.SolveConflictHandler".
- * It will be removed soon.
- *
- * @author Martin Fluegge
- */
-@Deprecated
-public class HandleConflictsAction implements IObjectActionDelegate
-{
- private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, HandleConflictsAction.class);
-
- private Object selectedElement;
-
- public final static String ID = "org.eclipse.emf.cdo.dawn.actions.HandleConflictAction";
-
- public void run(IAction action)
- {
-
- if (TRACER.isEnabled())
- {
- TRACER.format("Start solving conflicts for {0}", selectedElement); //$NON-NLS-1$
- }
-
- IEditorPart activeEditor = DawnEditorHelper.getActiveEditor();
- if (activeEditor instanceof IDawnEditor)
- {
- MessageDialog dialog = new MessageDialog(DawnEditorHelper.getActiveShell(), "Conflict", null,
- "There are conflicts in your diagram. Would you like to rollback your current transaction?",
- MessageDialog.QUESTION, new String[] { "yes", "no", "Cancel" }, 1);
-
- switch (dialog.open())
- {
- case 0: // yes
- // DawnConflictHelper.rollback((DiagramDocumentEditor)activeEditor);
- ((IDawnEditor)activeEditor).getDawnEditorSupport().rollback();
- break;
- case 1: // no
- break;
- default: // cancel
- break;
- }
- }
- }
-
- public void selectionChanged(IAction action, ISelection selection)
- {
- selectedElement = null;
- if (selection instanceof IStructuredSelection)
- {
- IStructuredSelection structuredSelection = (IStructuredSelection)selection;
- // if (structuredSelection.getFirstElement() instanceof EditPart)
- {
- selectedElement = structuredSelection.getFirstElement();
- }
- }
- }
-
- public void setActivePart(IAction action, IWorkbenchPart targetPart)
- {
- }
-}
+/* + * 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: + * Martin Fluegge - initial API and implementation + */ +package org.eclipse.emf.cdo.dawn.actions; + +import org.eclipse.emf.cdo.dawn.editors.IDawnEditor; +import org.eclipse.emf.cdo.dawn.helper.DawnEditorHelper; +import org.eclipse.emf.cdo.internal.dawn.bundle.OM; + +import org.eclipse.net4j.util.om.trace.ContextTracer; + +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IObjectActionDelegate; +import org.eclipse.ui.IWorkbenchPart; + +/** + * Since Dawn 0.2 this class is deprecated and replaced with "org.eclipse.emf.cdo.dawn.handlers.SolveConflictHandler". + * It will be removed soon. + * + * @author Martin Fluegge + */ +@Deprecated +public class HandleConflictsAction implements IObjectActionDelegate +{ + private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, HandleConflictsAction.class); + + private Object selectedElement; + + public final static String ID = "org.eclipse.emf.cdo.dawn.actions.HandleConflictAction"; + + public void run(IAction action) + { + + if (TRACER.isEnabled()) + { + TRACER.format("Start solving conflicts for {0}", selectedElement); //$NON-NLS-1$ + } + + IEditorPart activeEditor = DawnEditorHelper.getActiveEditor(); + if (activeEditor instanceof IDawnEditor) + { + MessageDialog dialog = new MessageDialog(DawnEditorHelper.getActiveShell(), "Conflict", null, + "There are conflicts in your diagram. Would you like to rollback your current transaction?", + MessageDialog.QUESTION, new String[] { "yes", "no", "Cancel" }, 1); + + switch (dialog.open()) + { + case 0: // yes + // DawnConflictHelper.rollback((DiagramDocumentEditor)activeEditor); + ((IDawnEditor)activeEditor).getDawnEditorSupport().rollback(); + break; + case 1: // no + break; + default: // cancel + break; + } + } + } + + public void selectionChanged(IAction action, ISelection selection) + { + selectedElement = null; + if (selection instanceof IStructuredSelection) + { + IStructuredSelection structuredSelection = (IStructuredSelection)selection; + // if (structuredSelection.getFirstElement() instanceof EditPart) + { + selectedElement = structuredSelection.getFirstElement(); + } + } + } + + public void setActivePart(IAction action, IWorkbenchPart targetPart) + { + } +} diff --git a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/actions/LockObjectsAction.java b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/actions/LockObjectsAction.java index d48d51d25f..03c82816ee 100644 --- a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/actions/LockObjectsAction.java +++ b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/actions/LockObjectsAction.java @@ -1,44 +1,44 @@ -/*
- * 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:
- * Martin Fluegge - initial API and implementation
- */
-package org.eclipse.emf.cdo.dawn.actions;
-
-import org.eclipse.emf.cdo.dawn.helper.DawnEditorHelper;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * @author Martin Fluegge
- */
-public class LockObjectsAction implements IObjectActionDelegate
-{
- public final static String ID = "org.eclipse.emf.cdo.dawn.LockObjectsAction";
-
- public LockObjectsAction()
- {
- }
-
- public void run(IAction action)
- {
- MessageDialog.openInformation(DawnEditorHelper.getActiveShell(), "", "Locking not yet supported.");
- }
-
- public void selectionChanged(IAction action, ISelection selection)
- {
- }
-
- public void setActivePart(IAction action, IWorkbenchPart targetPart)
- {
- }
-}
+/* + * 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: + * Martin Fluegge - initial API and implementation + */ +package org.eclipse.emf.cdo.dawn.actions; + +import org.eclipse.emf.cdo.dawn.helper.DawnEditorHelper; + +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.ui.IObjectActionDelegate; +import org.eclipse.ui.IWorkbenchPart; + +/** + * @author Martin Fluegge + */ +public class LockObjectsAction implements IObjectActionDelegate +{ + public final static String ID = "org.eclipse.emf.cdo.dawn.LockObjectsAction"; + + public LockObjectsAction() + { + } + + public void run(IAction action) + { + MessageDialog.openInformation(DawnEditorHelper.getActiveShell(), "", "Locking not yet supported."); + } + + public void selectionChanged(IAction action, ISelection selection) + { + } + + public void setActivePart(IAction action, IWorkbenchPart targetPart) + { + } +} diff --git a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/actions/UnLockObjectsAction.java b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/actions/UnLockObjectsAction.java index 6df111b6a3..dde70b230e 100644 --- a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/actions/UnLockObjectsAction.java +++ b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/actions/UnLockObjectsAction.java @@ -1,44 +1,44 @@ -/*
- * 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:
- * Martin Fluegge - initial API and implementation
- */
-package org.eclipse.emf.cdo.dawn.actions;
-
-import org.eclipse.emf.cdo.dawn.helper.DawnEditorHelper;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * @author Martin Fluegge
- */
-public class UnLockObjectsAction implements IObjectActionDelegate
-{
- public final static String ID = "org.eclipse.emf.cdo.dawn.UnlockObjectsAction";
-
- public UnLockObjectsAction()
- {
- }
-
- public void run(IAction action)
- {
- MessageDialog.openInformation(DawnEditorHelper.getActiveShell(), "", "Locking not yet supported");
- }
-
- public void selectionChanged(IAction action, ISelection selection)
- {
- }
-
- public void setActivePart(IAction action, IWorkbenchPart targetPart)
- {
- }
-}
+/* + * 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: + * Martin Fluegge - initial API and implementation + */ +package org.eclipse.emf.cdo.dawn.actions; + +import org.eclipse.emf.cdo.dawn.helper.DawnEditorHelper; + +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.ui.IObjectActionDelegate; +import org.eclipse.ui.IWorkbenchPart; + +/** + * @author Martin Fluegge + */ +public class UnLockObjectsAction implements IObjectActionDelegate +{ + public final static String ID = "org.eclipse.emf.cdo.dawn.UnlockObjectsAction"; + + public UnLockObjectsAction() + { + } + + public void run(IAction action) + { + MessageDialog.openInformation(DawnEditorHelper.getActiveShell(), "", "Locking not yet supported"); + } + + public void selectionChanged(IAction action, ISelection selection) + { + } + + public void setActivePart(IAction action, IWorkbenchPart targetPart) + { + } +} diff --git a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/appearance/DawnElementStylizer.java b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/appearance/DawnElementStylizer.java index 9ed9cc518a..e344a6e966 100644 --- a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/appearance/DawnElementStylizer.java +++ b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/appearance/DawnElementStylizer.java @@ -1,47 +1,47 @@ -/*
- * 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:
- * Martin Fluegge - initial API and implementation
- */
-package org.eclipse.emf.cdo.dawn.appearance;
-
-import org.eclipse.emf.cdo.dawn.spi.DawnState;
-
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * This interface is used do influence the appearance of an UI element by a certain state. Implementations allow to
- * change the appearance for the adapted types of editors.
- *
- * @author Martin Fluegge
- * @since 2.0
- */
-public interface DawnElementStylizer
-{
- public void setDefault(Object element);
-
- public void setConflicted(Object element, int type);
-
- public void setLocked(Object element, int type);
-
- /**
- * Returns the image that represents the state for the given object.
- */
- public Image getImage(Object element, DawnState state);
-
- /**
- * Returns the foreground color that represents the state for the given object.
- */
- public Color getForegroundColor(Object element, DawnState state);
-
- /**
- * Returns the background color that represents the state for the given object.
- */
- public Color getBackgroundColor(Object element, DawnState state);
-}
+/* + * 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: + * Martin Fluegge - initial API and implementation + */ +package org.eclipse.emf.cdo.dawn.appearance; + +import org.eclipse.emf.cdo.dawn.spi.DawnState; + +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.Image; + +/** + * This interface is used do influence the appearance of an UI element by a certain state. Implementations allow to + * change the appearance for the adapted types of editors. + * + * @author Martin Fluegge + * @since 2.0 + */ +public interface DawnElementStylizer +{ + public void setDefault(Object element); + + public void setConflicted(Object element, int type); + + public void setLocked(Object element, int type); + + /** + * Returns the image that represents the state for the given object. + */ + public Image getImage(Object element, DawnState state); + + /** + * Returns the foreground color that represents the state for the given object. + */ + public Color getForegroundColor(Object element, DawnState state); + + /** + * Returns the background color that represents the state for the given object. + */ + public Color getBackgroundColor(Object element, DawnState state); +} diff --git a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/appearance/IDawnElementStylizerFactory.java b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/appearance/IDawnElementStylizerFactory.java index 36ff3af48a..9f29c85d9c 100644 --- a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/appearance/IDawnElementStylizerFactory.java +++ b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/appearance/IDawnElementStylizerFactory.java @@ -1,20 +1,20 @@ -/*
- * 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:
- * Martin Fluegge - initial API and implementation
- */
-package org.eclipse.emf.cdo.dawn.appearance;
-
-/**
- * @author Martin Fluegge
- * @since 2.0
- */
-public interface IDawnElementStylizerFactory
-{
- public DawnElementStylizer getElementStylizer(Object object);
-}
+/* + * 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: + * Martin Fluegge - initial API and implementation + */ +package org.eclipse.emf.cdo.dawn.appearance; + +/** + * @author Martin Fluegge + * @since 2.0 + */ +public interface IDawnElementStylizerFactory +{ + public DawnElementStylizer getElementStylizer(Object object); +} diff --git a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/commands/CreateSemanticResourceRecordingCommand.java b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/commands/CreateSemanticResourceRecordingCommand.java index 7873751915..9e58e9bb87 100644 --- a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/commands/CreateSemanticResourceRecordingCommand.java +++ b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/commands/CreateSemanticResourceRecordingCommand.java @@ -1,49 +1,49 @@ -/*
- * 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:
- * Martin Fluegge - initial API and implementation
- */
-package org.eclipse.emf.cdo.dawn.commands;
-
-import org.eclipse.emf.cdo.transaction.CDOTransaction;
-
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-
-/**
- * @author Martin Fluegge
- */
-public class CreateSemanticResourceRecordingCommand extends RecordingCommand
-{
-
- private final CDOTransaction cdoTransaction;
-
- private Resource resource;
-
- private final String resourcePath;
-
- public CreateSemanticResourceRecordingCommand(TransactionalEditingDomain editingDomain,
- CDOTransaction cdoTransaction, String resourcePath)
- {
- super(editingDomain);
- this.cdoTransaction = cdoTransaction;
- this.resourcePath = resourcePath;
- }
-
- @Override
- protected void doExecute()
- {
- resource = cdoTransaction.getOrCreateResource(resourcePath.replace("cdo:", ""));
- }
-
- public Resource getResource()
- {
- return resource;
- }
-}
+/* + * 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: + * Martin Fluegge - initial API and implementation + */ +package org.eclipse.emf.cdo.dawn.commands; + +import org.eclipse.emf.cdo.transaction.CDOTransaction; + +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.transaction.RecordingCommand; +import org.eclipse.emf.transaction.TransactionalEditingDomain; + +/** + * @author Martin Fluegge + */ +public class CreateSemanticResourceRecordingCommand extends RecordingCommand +{ + + private final CDOTransaction cdoTransaction; + + private Resource resource; + + private final String resourcePath; + + public CreateSemanticResourceRecordingCommand(TransactionalEditingDomain editingDomain, + CDOTransaction cdoTransaction, String resourcePath) + { + super(editingDomain); + this.cdoTransaction = cdoTransaction; + this.resourcePath = resourcePath; + } + + @Override + protected void doExecute() + { + resource = cdoTransaction.getOrCreateResource(resourcePath.replace("cdo:", "")); + } + + public Resource getResource() + { + return resource; + } +} diff --git a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/conflicts/ResourceSynchronizer.java b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/conflicts/ResourceSynchronizer.java index f69506b40a..84cf28444e 100644 --- a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/conflicts/ResourceSynchronizer.java +++ b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/conflicts/ResourceSynchronizer.java @@ -1,88 +1,88 @@ -/*
- * 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:
- * Martin Fluegge - initial API and implementation
- */
-package org.eclipse.emf.cdo.dawn.conflicts;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-
-import java.util.Map;
-import java.util.Observer;
-import java.util.Set;
-
-/**
- * Since Dawn 2.0 this interface is deprecated and will be removed soon. Because it was never really used, there will be
- * no surragote.
- *
- * @author Martin Fluegge
- */
-@Deprecated
-public interface ResourceSynchronizer
-{
- public static final int NO_CONFLICT = -1;
-
- public static final int REMOTELY_DELTETION_CONFLICT = 0;
-
- public static final int LOCALLY_DELTETION_CONFLICT = 1;
-
- public static final int REMOTELY_AND_LOCALLY_CHANGED_CONFLICT = 2;
-
- void loadLastResource();
-
- void saveLastResource(Resource localResource);
-
- void setGloballyLocked(Set<String> lockedObjects);
-
- Set<String> getGloballyLocked();
-
- void setRemoteLocks(Map<String, Integer> lockedObjects);
-
- void setIgnored(EObject obj);
-
- void setIgnored(String id);
-
- void setLastResource(Resource lastResource);
-
- Resource getLastResource();
-
- void unIgnored(String id);
-
- int getConflictType(String key);
-
- void resolveDeletedLocallyConflict(String xmiId);
-
- void resolveChangedLocalyAndRemotellyConflict(String xmiId);
-
- void resolveDeletedRemotellyConflict(String xmiId);
-
- // void updateViewWithRemoteView(View obj);
- //
- // void lastResourceDeleteView(View newView);
- //
- // void lastResourceChangeView(View newView);
-
- boolean isConflicted();
-
- void cleanIgnoreList();
-
- void setSelectedElements(Set<EObject> selectedElements);
-
- Set<EObject> getSelectedElements();
-
- void setIgnoreList(Set<String> ignoreList);
-
- Set<String> getIgnoreList();
-
- void setLocallyLocked(Set<String> locallyLocked);
-
- Set<String> getLocallyLocked();
-
- void addObserver(Observer observer);
-}
+/* + * 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: + * Martin Fluegge - initial API and implementation + */ +package org.eclipse.emf.cdo.dawn.conflicts; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; + +import java.util.Map; +import java.util.Observer; +import java.util.Set; + +/** + * Since Dawn 2.0 this interface is deprecated and will be removed soon. Because it was never really used, there will be + * no surragote. + * + * @author Martin Fluegge + */ +@Deprecated +public interface ResourceSynchronizer +{ + public static final int NO_CONFLICT = -1; + + public static final int REMOTELY_DELTETION_CONFLICT = 0; + + public static final int LOCALLY_DELTETION_CONFLICT = 1; + + public static final int REMOTELY_AND_LOCALLY_CHANGED_CONFLICT = 2; + + void loadLastResource(); + + void saveLastResource(Resource localResource); + + void setGloballyLocked(Set<String> lockedObjects); + + Set<String> getGloballyLocked(); + + void setRemoteLocks(Map<String, Integer> lockedObjects); + + void setIgnored(EObject obj); + + void setIgnored(String id); + + void setLastResource(Resource lastResource); + + Resource getLastResource(); + + void unIgnored(String id); + + int getConflictType(String key); + + void resolveDeletedLocallyConflict(String xmiId); + + void resolveChangedLocalyAndRemotellyConflict(String xmiId); + + void resolveDeletedRemotellyConflict(String xmiId); + + // void updateViewWithRemoteView(View obj); + // + // void lastResourceDeleteView(View newView); + // + // void lastResourceChangeView(View newView); + + boolean isConflicted(); + + void cleanIgnoreList(); + + void setSelectedElements(Set<EObject> selectedElements); + + Set<EObject> getSelectedElements(); + + void setIgnoreList(Set<String> ignoreList); + + Set<String> getIgnoreList(); + + void setLocallyLocked(Set<String> locallyLocked); + + Set<String> getLocallyLocked(); + + void addObserver(Observer observer); +} diff --git a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/editors/IDawnEditor.java b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/editors/IDawnEditor.java index cb4925c153..b31f193067 100644 --- a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/editors/IDawnEditor.java +++ b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/editors/IDawnEditor.java @@ -1,23 +1,23 @@ -/*
- * 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:
- * Martin Fluegge - initial API and implementation
- */
-package org.eclipse.emf.cdo.dawn.editors;
-
-import org.eclipse.emf.cdo.dawn.spi.IDawnUIElement;
-
-import org.eclipse.ui.IEditorPart;
-
-/**
- * @author Martin Fluegge
- */
-public interface IDawnEditor extends IDawnUIElement, IEditorPart
-{
- public String getContributorID();
-}
+/* + * 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: + * Martin Fluegge - initial API and implementation + */ +package org.eclipse.emf.cdo.dawn.editors; + +import org.eclipse.emf.cdo.dawn.spi.IDawnUIElement; + +import org.eclipse.ui.IEditorPart; + +/** + * @author Martin Fluegge + */ +public interface IDawnEditor extends IDawnUIElement, IEditorPart +{ + public String getContributorID(); +} diff --git a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/editors/IDawnEditorSupport.java b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/editors/IDawnEditorSupport.java index 092ca9863d..c5be53c0de 100644 --- a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/editors/IDawnEditorSupport.java +++ b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/editors/IDawnEditorSupport.java @@ -1,21 +1,21 @@ -/*
- * 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:
- * Martin Fluegge - initial API and implementation
- */
-package org.eclipse.emf.cdo.dawn.editors;
-
-import org.eclipse.emf.cdo.dawn.spi.IDawnEditingSupport;
-
-/**
- * @author Martin Fluegge
- */
-public interface IDawnEditorSupport extends IDawnEditingSupport
-{
-
-}
+/* + * 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: + * Martin Fluegge - initial API and implementation + */ +package org.eclipse.emf.cdo.dawn.editors; + +import org.eclipse.emf.cdo.dawn.spi.IDawnEditingSupport; + +/** + * @author Martin Fluegge + */ +public interface IDawnEditorSupport extends IDawnEditingSupport +{ + +} diff --git a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/editors/impl/DawnAbstractEditorSupport.java b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/editors/impl/DawnAbstractEditorSupport.java index 251ecd1d50..bb9770ab4a 100644 --- a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/editors/impl/DawnAbstractEditorSupport.java +++ b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/editors/impl/DawnAbstractEditorSupport.java @@ -1,165 +1,165 @@ -/*
- * 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:
- * Martin Fluegge - initial API and implementation
- */
-package org.eclipse.emf.cdo.dawn.editors.impl;
-
-import org.eclipse.emf.cdo.dawn.editors.IDawnEditor;
-import org.eclipse.emf.cdo.dawn.editors.IDawnEditorSupport;
-import org.eclipse.emf.cdo.dawn.notifications.BasicDawnListener;
-import org.eclipse.emf.cdo.transaction.CDOTransaction;
-import org.eclipse.emf.cdo.transaction.CDOTransactionHandlerBase;
-import org.eclipse.emf.cdo.view.CDOAdapterPolicy;
-import org.eclipse.emf.cdo.view.CDOView;
-
-import java.util.List;
-
-/**
- * @author Martin Fluegge
- */
-public abstract class DawnAbstractEditorSupport implements IDawnEditorSupport
-{
- private final IDawnEditor editor;
-
- private CDOView view;
-
- private boolean dirty;
-
- public CDOView getView()
- {
- return view;
- }
-
- public void setView(CDOView view)
- {
- this.view = view;
- }
-
- public DawnAbstractEditorSupport(IDawnEditor editor)
- {
- this.editor = editor;
- }
-
- public void setDirty(boolean dirty)
- {
- this.dirty = dirty;
- }
-
- public boolean isDirty()
- {
- return dirty;
- }
-
- public IDawnEditor getEditor()
- {
- return editor;
- }
-
- /**
- * This method registeres the listeners for the DawnEditorSupport. Concrete implementaions can influence the
- * registered listeneres by implementing the methods
- * <ul>
- * <li>getBasicHandler()</li>
- * <li>getLockingHandler()</li>
- * </ul>
- * If one of these methods returns null the specific handler will not be registered and activated.
- *
- * @see #getBasicHandler()
- * @see #getLockingHandler()
- * @since 2.0
- */
- public void registerListeners()
- {
- BasicDawnListener listener = getBasicHandler();
- CDOView view = getView();
-
- if (listener != null)
- {
- view.addListener(listener);
- }
-
- BasicDawnListener lockingHandler = getLockingHandler();
- if (lockingHandler != null)
- {
- view.addListener(lockingHandler);
- view.options().setLockNotificationEnabled(true);
- }
-
- if (view instanceof CDOTransaction)
- {
- CDOTransaction transaction = (CDOTransaction)view;
- CDOTransactionHandlerBase transactionHandler = getTransactionHandler();
- if (transactionHandler != null)
- {
- transaction.addTransactionHandler(transactionHandler);
- }
- transaction.options().addChangeSubscriptionPolicy(CDOAdapterPolicy.CDO);
- transaction.options().setAutoReleaseLocksEnabled(false);
- }
- }
-
- /**
- * Subclasses must implement this method to deliver a IDawnListener that implements the behavior for Session
- * invalidations. If the method returns null, the handler will not be registered.
- *
- * @since 2.0
- */
- protected abstract BasicDawnListener getBasicHandler();
-
- /**
- * Subclasses must implement this method to deliver a IDawnListener that implements the behavior for remote locking
- * notifications. If the method returns null, the handler will not be registered.
- *
- * @since 2.0
- */
- protected abstract BasicDawnListener getLockingHandler();
-
- /**
- * Subclasses must implement this method to deliver a CDOTransactionHandlerBase that implements the behavior for
- * remote changes notifications. If the method returns null, the handler will not be registered.
- *
- * @since 2.0
- */
- protected abstract CDOTransactionHandlerBase getTransactionHandler();
-
- /**
- * @since 1.0
- */
- public void rollback()
- {
- CDOView view = getEditor().getView();
-
- if (view != null && view instanceof CDOTransaction)
- {
- ((CDOTransaction)view).rollback();
- }
- }
-
- /**
- * @since 2.0
- */
- public void lockObjects(List<Object> objectsToBeLocked)
- {
- for (Object objectToBeLocked : objectsToBeLocked)
- {
- lockObject(objectToBeLocked);
- }
- }
-
- /**
- * @since 2.0
- */
- public void unlockObjects(List<Object> objectsToBeLocked)
- {
- for (Object objectToBeUnlocked : objectsToBeLocked)
- {
- unlockObject(objectToBeUnlocked);
- }
- }
-}
+/* + * 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: + * Martin Fluegge - initial API and implementation + */ +package org.eclipse.emf.cdo.dawn.editors.impl; + +import org.eclipse.emf.cdo.dawn.editors.IDawnEditor; +import org.eclipse.emf.cdo.dawn.editors.IDawnEditorSupport; +import org.eclipse.emf.cdo.dawn.notifications.BasicDawnListener; +import org.eclipse.emf.cdo.transaction.CDOTransaction; +import org.eclipse.emf.cdo.transaction.CDOTransactionHandlerBase; +import org.eclipse.emf.cdo.view.CDOAdapterPolicy; +import org.eclipse.emf.cdo.view.CDOView; + +import java.util.List; + +/** + * @author Martin Fluegge + */ +public abstract class DawnAbstractEditorSupport implements IDawnEditorSupport +{ + private final IDawnEditor editor; + + private CDOView view; + + private boolean dirty; + + public CDOView getView() + { + return view; + } + + public void setView(CDOView view) + { + this.view = view; + } + + public DawnAbstractEditorSupport(IDawnEditor editor) + { + this.editor = editor; + } + + public void setDirty(boolean dirty) + { + this.dirty = dirty; + } + + public boolean isDirty() + { + return dirty; + } + + public IDawnEditor getEditor() + { + return editor; + } + + /** + * This method registeres the listeners for the DawnEditorSupport. Concrete implementaions can influence the + * registered listeneres by implementing the methods + * <ul> + * <li>getBasicHandler()</li> + * <li>getLockingHandler()</li> + * </ul> + * If one of these methods returns null the specific handler will not be registered and activated. + * + * @see #getBasicHandler() + * @see #getLockingHandler() + * @since 2.0 + */ + public void registerListeners() + { + BasicDawnListener listener = getBasicHandler(); + CDOView view = getView(); + + if (listener != null) + { + view.addListener(listener); + } + + BasicDawnListener lockingHandler = getLockingHandler(); + if (lockingHandler != null) + { + view.addListener(lockingHandler); + view.options().setLockNotificationEnabled(true); + } + + if (view instanceof CDOTransaction) + { + CDOTransaction transaction = (CDOTransaction)view; + CDOTransactionHandlerBase transactionHandler = getTransactionHandler(); + if (transactionHandler != null) + { + transaction.addTransactionHandler(transactionHandler); + } + transaction.options().addChangeSubscriptionPolicy(CDOAdapterPolicy.CDO); + transaction.options().setAutoReleaseLocksEnabled(false); + } + } + + /** + * Subclasses must implement this method to deliver a IDawnListener that implements the behavior for Session + * invalidations. If the method returns null, the handler will not be registered. + * + * @since 2.0 + */ + protected abstract BasicDawnListener getBasicHandler(); + + /** + * Subclasses must implement this method to deliver a IDawnListener that implements the behavior for remote locking + * notifications. If the method returns null, the handler will not be registered. + * + * @since 2.0 + */ + protected abstract BasicDawnListener getLockingHandler(); + + /** + * Subclasses must implement this method to deliver a CDOTransactionHandlerBase that implements the behavior for + * remote changes notifications. If the method returns null, the handler will not be registered. + * + * @since 2.0 + */ + protected abstract CDOTransactionHandlerBase getTransactionHandler(); + + /** + * @since 1.0 + */ + public void rollback() + { + CDOView view = getEditor().getView(); + + if (view != null && view instanceof CDOTransaction) + { + ((CDOTransaction)view).rollback(); + } + } + + /** + * @since 2.0 + */ + public void lockObjects(List<Object> objectsToBeLocked) + { + for (Object objectToBeLocked : objectsToBeLocked) + { + lockObject(objectToBeLocked); + } + } + + /** + * @since 2.0 + */ + public void unlockObjects(List<Object> objectsToBeLocked) + { + for (Object objectToBeUnlocked : objectsToBeLocked) + { + unlockObject(objectToBeUnlocked); + } + } +} diff --git a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/helper/DawnEditorHelper.java b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/helper/DawnEditorHelper.java index bfb9a4d7c3..763e6a92bf 100644 --- a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/helper/DawnEditorHelper.java +++ b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/helper/DawnEditorHelper.java @@ -1,74 +1,74 @@ -/*
- * 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:
- * Martin Fluegge - initial API and implementation
- */
-package org.eclipse.emf.cdo.dawn.helper;
-
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * TODO move this one to the dawn.util bundle
- *
- * @author Martin Fluegge
- */
-public class DawnEditorHelper
-{
- /**
- * Delivers the active shell from the current display.
- *
- * @return the active shell on the current display
- */
- public static Shell getActiveShell()
- {
- Shell shell = Display.getCurrent().getActiveShell();
- return shell;
- }
-
- /**
- * This method returns the active editor from the active workbench page
- *
- * @return the active editor from the active workbench page or null if there is none
- */
- public static IEditorPart getActiveEditor()
- {
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- IEditorPart editor = null;
- if (window != null)
- {
- IWorkbenchPage page = window.getActivePage();
- if (page != null)
- {
- editor = page.getActiveEditor();
- }
- }
- return editor;
- }
-
- /**
- * This method tries to retrieve a Display. First it tries to get the current display. If this fails it will return
- * the default display.
- *
- * @return the current display, if not null. If the current Display is null then the default Display.
- * @since 2.0
- */
- public static Display getDisplay()
- {
- Display display = Display.getCurrent();
- if (display == null)
- {
- display = Display.getDefault();
- }
- return display;
- }
-}
+/* + * 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: + * Martin Fluegge - initial API and implementation + */ +package org.eclipse.emf.cdo.dawn.helper; + +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; + +/** + * TODO move this one to the dawn.util bundle + * + * @author Martin Fluegge + */ +public class DawnEditorHelper +{ + /** + * Delivers the active shell from the current display. + * + * @return the active shell on the current display + */ + public static Shell getActiveShell() + { + Shell shell = Display.getCurrent().getActiveShell(); + return shell; + } + + /** + * This method returns the active editor from the active workbench page + * + * @return the active editor from the active workbench page or null if there is none + */ + public static IEditorPart getActiveEditor() + { + IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + IEditorPart editor = null; + if (window != null) + { + IWorkbenchPage page = window.getActivePage(); + if (page != null) + { + editor = page.getActiveEditor(); + } + } + return editor; + } + + /** + * This method tries to retrieve a Display. First it tries to get the current display. If this fails it will return + * the default display. + * + * @return the current display, if not null. If the current Display is null then the default Display. + * @since 2.0 + */ + public static Display getDisplay() + { + Display display = Display.getCurrent(); + if (display == null) + { + display = Display.getDefault(); + } + return display; + } +} diff --git a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/notifications/BasicDawnListener.java b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/notifications/BasicDawnListener.java index d7e96d967f..fbef78974d 100644 --- a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/notifications/BasicDawnListener.java +++ b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/notifications/BasicDawnListener.java @@ -1,91 +1,91 @@ -/*
- * 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:
- * Martin Fluegge - initial API and implementation
- */
-package org.eclipse.emf.cdo.dawn.notifications;
-
-import org.eclipse.emf.cdo.dawn.editors.IDawnEditor;
-import org.eclipse.emf.cdo.transaction.CDOTransactionConflictEvent;
-import org.eclipse.emf.cdo.view.CDOViewInvalidationEvent;
-import org.eclipse.emf.cdo.view.CDOViewLocksChangedEvent;
-
-import org.eclipse.net4j.util.event.IEvent;
-
-/**
- * @author Martin Fluegge
- */
-public abstract class BasicDawnListener implements IDawnListener// implements IListener
-{
- protected IDawnEditor editor;
-
- /**
- * @since 1.0
- */
- public void setEditor(IDawnEditor editor)
- {
- this.editor = editor;
- }
-
- /**
- * @since 1.0
- */
- public BasicDawnListener()
- {
- }
-
- /**
- * @since 1.0
- */
- public BasicDawnListener(IDawnEditor editor)
- {
- this.editor = editor;
- }
-
- public void notifyEvent(IEvent event)
- {
- if (event instanceof CDOViewInvalidationEvent)
- {
- handleViewInvalidationEvent((CDOViewInvalidationEvent)event);
- }
- else if (event instanceof CDOTransactionConflictEvent)
- {
- handleTransactionConflictEvent((CDOTransactionConflictEvent)event);
- }
- else if (event instanceof CDOViewLocksChangedEvent)
- {
- handleLocksChangedEvent((CDOViewLocksChangedEvent)event);
- }
- else
- {
- handleEvent(event);
- }
- }
-
- public void handleViewInvalidationEvent(CDOViewInvalidationEvent event)
- {
- }
-
- public void handleTransactionConflictEvent(CDOTransactionConflictEvent event)
- {
- }
-
- /**
- * @since 2.0
- */
- public void handleLocksChangedEvent(CDOViewLocksChangedEvent event)
- {
- }
-
- /**
- * @since 2.0
- */
- public void handleEvent(IEvent event)
- {
- }
-}
+/* + * 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: + * Martin Fluegge - initial API and implementation + */ +package org.eclipse.emf.cdo.dawn.notifications; + +import org.eclipse.emf.cdo.dawn.editors.IDawnEditor; +import org.eclipse.emf.cdo.transaction.CDOTransactionConflictEvent; +import org.eclipse.emf.cdo.view.CDOViewInvalidationEvent; +import org.eclipse.emf.cdo.view.CDOViewLocksChangedEvent; + +import org.eclipse.net4j.util.event.IEvent; + +/** + * @author Martin Fluegge + */ +public abstract class BasicDawnListener implements IDawnListener// implements IListener +{ + protected IDawnEditor editor; + + /** + * @since 1.0 + */ + public void setEditor(IDawnEditor editor) + { + this.editor = editor; + } + + /** + * @since 1.0 + */ + public BasicDawnListener() + { + } + + /** + * @since 1.0 + */ + public BasicDawnListener(IDawnEditor editor) + { + this.editor = editor; + } + + public void notifyEvent(IEvent event) + { + if (event instanceof CDOViewInvalidationEvent) + { + handleViewInvalidationEvent((CDOViewInvalidationEvent)event); + } + else if (event instanceof CDOTransactionConflictEvent) + { + handleTransactionConflictEvent((CDOTransactionConflictEvent)event); + } + else if (event instanceof CDOViewLocksChangedEvent) + { + handleLocksChangedEvent((CDOViewLocksChangedEvent)event); + } + else + { + handleEvent(event); + } + } + + public void handleViewInvalidationEvent(CDOViewInvalidationEvent event) + { + } + + public void handleTransactionConflictEvent(CDOTransactionConflictEvent event) + { + } + + /** + * @since 2.0 + */ + public void handleLocksChangedEvent(CDOViewLocksChangedEvent event) + { + } + + /** + * @since 2.0 + */ + public void handleEvent(IEvent event) + { + } +} diff --git a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/notifications/BasicDawnLockingHandler.java b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/notifications/BasicDawnLockingHandler.java index cfd8867d57..d89a673d4a 100644 --- a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/notifications/BasicDawnLockingHandler.java +++ b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/notifications/BasicDawnLockingHandler.java @@ -1,87 +1,87 @@ -/*
- * 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:
- * Martin Fluegge - initial API and implementation
- */
-package org.eclipse.emf.cdo.dawn.notifications;
-
-import org.eclipse.emf.cdo.CDOObject;
-import org.eclipse.emf.cdo.common.id.CDOID;
-import org.eclipse.emf.cdo.common.lock.CDOLockState;
-import org.eclipse.emf.cdo.common.revision.CDOIDAndBranch;
-import org.eclipse.emf.cdo.dawn.editors.IDawnEditor;
-import org.eclipse.emf.cdo.dawn.editors.IDawnEditorSupport;
-import org.eclipse.emf.cdo.dawn.spi.DawnState;
-import org.eclipse.emf.cdo.view.CDOView;
-import org.eclipse.emf.cdo.view.CDOViewLocksChangedEvent;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author Martin Fluegge
- * @since 2.0
- */
-public class BasicDawnLockingHandler extends BasicDawnListener
-{
- public BasicDawnLockingHandler(IDawnEditor editor)
- {
- super(editor);
- }
-
- @Override
- public void handleLocksChangedEvent(CDOViewLocksChangedEvent event)
- {
- CDOViewLocksChangedEvent lockEvent = event;
-
- CDOLockState[] lockStates = lockEvent.getLockStates();
-
- Map<Object, DawnState> changedObjects = new HashMap<Object, DawnState>();
-
- for (CDOLockState state : lockStates)
- {
- Object lockedObject = state.getLockedObject();
-
- CDOView view = editor.getDawnEditorSupport().getView();
- CDOID id;
- if (lockedObject instanceof CDOID)
- {
- id = (CDOID)lockedObject;
- }
- else if (lockedObject instanceof CDOIDAndBranch)
- {
- id = ((CDOIDAndBranch)lockedObject).getID();
- }
- else
- {
- throw new RuntimeException("Unexpected object type: " + lockedObject);
- }
-
- if (id != null)
- {
- CDOObject object = view.getObject(id);
- if (object.cdoWriteLock().isLocked())
- {
- throw new RuntimeException("Locally locked objects should not occur.");
- }
- else if (object.cdoWriteLock().isLockedByOthers())
- {
- changedObjects.put(object, DawnState.LOCKED_REMOTELY);
- }
- else
- {
- changedObjects.put(object, DawnState.CLEAN);
- }
- }
- }
-
- IDawnEditorSupport dawnEditorSupport = editor.getDawnEditorSupport();
-
- dawnEditorSupport.handleRemoteLockChanges(changedObjects);
- }
-}
+/* + * 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: + * Martin Fluegge - initial API and implementation + */ +package org.eclipse.emf.cdo.dawn.notifications; + +import org.eclipse.emf.cdo.CDOObject; +import org.eclipse.emf.cdo.common.id.CDOID; +import org.eclipse.emf.cdo.common.lock.CDOLockState; +import org.eclipse.emf.cdo.common.revision.CDOIDAndBranch; +import org.eclipse.emf.cdo.dawn.editors.IDawnEditor; +import org.eclipse.emf.cdo.dawn.editors.IDawnEditorSupport; +import org.eclipse.emf.cdo.dawn.spi.DawnState; +import org.eclipse.emf.cdo.view.CDOView; +import org.eclipse.emf.cdo.view.CDOViewLocksChangedEvent; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author Martin Fluegge + * @since 2.0 + */ +public class BasicDawnLockingHandler extends BasicDawnListener +{ + public BasicDawnLockingHandler(IDawnEditor editor) + { + super(editor); + } + + @Override + public void handleLocksChangedEvent(CDOViewLocksChangedEvent event) + { + CDOViewLocksChangedEvent lockEvent = event; + + CDOLockState[] lockStates = lockEvent.getLockStates(); + + Map<Object, DawnState> changedObjects = new HashMap<Object, DawnState>(); + + for (CDOLockState state : lockStates) + { + Object lockedObject = state.getLockedObject(); + + CDOView view = editor.getDawnEditorSupport().getView(); + CDOID id; + if (lockedObject instanceof CDOID) + { + id = (CDOID)lockedObject; + } + else if (lockedObject instanceof CDOIDAndBranch) + { + id = ((CDOIDAndBranch)lockedObject).getID(); + } + else + { + throw new RuntimeException("Unexpected object type: " + lockedObject); + } + + if (id != null) + { + CDOObject object = view.getObject(id); + if (object.cdoWriteLock().isLocked()) + { + throw new RuntimeException("Locally locked objects should not occur."); + } + else if (object.cdoWriteLock().isLockedByOthers()) + { + changedObjects.put(object, DawnState.LOCKED_REMOTELY); + } + else + { + changedObjects.put(object, DawnState.CLEAN); + } + } + } + + IDawnEditorSupport dawnEditorSupport = editor.getDawnEditorSupport(); + + dawnEditorSupport.handleRemoteLockChanges(changedObjects); + } +} diff --git a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/notifications/BasicDawnTransactionHandler.java b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/notifications/BasicDawnTransactionHandler.java index 4a342dc4c7..1d5fbdc64d 100644 --- a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/notifications/BasicDawnTransactionHandler.java +++ b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/notifications/BasicDawnTransactionHandler.java @@ -1,93 +1,93 @@ -/*
- * 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:
- * Martin Fluegge - initial API and implementation
- */
-package org.eclipse.emf.cdo.dawn.notifications;
-
-import org.eclipse.emf.cdo.CDOObject;
-import org.eclipse.emf.cdo.common.revision.delta.CDOFeatureDelta;
-import org.eclipse.emf.cdo.dawn.editors.IDawnEditor;
-import org.eclipse.emf.cdo.internal.dawn.bundle.OM;
-import org.eclipse.emf.cdo.transaction.CDOCommitContext;
-import org.eclipse.emf.cdo.transaction.CDOTransaction;
-import org.eclipse.emf.cdo.transaction.CDOTransactionConflictEvent;
-import org.eclipse.emf.cdo.view.CDOViewInvalidationEvent;
-
-import org.eclipse.net4j.util.event.IEvent;
-import org.eclipse.net4j.util.om.trace.ContextTracer;
-
-/**
- * @author Martin Fluegge
- * @since 2.0
- */
-public class BasicDawnTransactionHandler extends BasicDawnListener implements IDawnTransactionHandler
-{
- private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, BasicDawnTransactionHandler.class);
-
- public BasicDawnTransactionHandler(IDawnEditor editor)
- {
- super(editor);
- }
-
- public void attachingObject(CDOTransaction transaction, CDOObject object)
- {
- if (TRACER.isEnabled())
- {
- TRACER.format("attachingObject {0}", object); //$NON-NLS-1$
- }
- editor.setDirty();
- }
-
- public void detachingObject(CDOTransaction transaction, CDOObject object)
- {
- if (TRACER.isEnabled())
- {
- TRACER.format("detachingObject {0}", object); //$NON-NLS-1$
- }
-
- editor.setDirty();
- }
-
- public void modifyingObject(CDOTransaction transaction, CDOObject object, CDOFeatureDelta featureDelta)
- {
- if (TRACER.isEnabled())
- {
- TRACER.format("modifyingObject {0}", object); //$NON-NLS-1$
- }
-
- editor.setDirty();
- }
-
- public void committingTransaction(CDOTransaction transaction, CDOCommitContext commitContext)
- { // This method can be overwritten be subclasses
- }
-
- public void committedTransaction(CDOTransaction transaction, CDOCommitContext commitContext)
- { // This method can be overwritten be subclasses
- }
-
- public void rolledBackTransaction(CDOTransaction transaction)
- { // This method can be overwritten be subclasses
- }
-
- @Override
- public void handleViewInvalidationEvent(CDOViewInvalidationEvent event)
- { // This method can be overwritten be subclasses
- }
-
- @Override
- public void handleTransactionConflictEvent(CDOTransactionConflictEvent event)
- { // This method can be overwritten be subclasses
- }
-
- @Override
- public void handleEvent(IEvent event)
- {
- }
-}
+/* + * 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: + * Martin Fluegge - initial API and implementation + */ +package org.eclipse.emf.cdo.dawn.notifications; + +import org.eclipse.emf.cdo.CDOObject; +import org.eclipse.emf.cdo.common.revision.delta.CDOFeatureDelta; +import org.eclipse.emf.cdo.dawn.editors.IDawnEditor; +import org.eclipse.emf.cdo.internal.dawn.bundle.OM; +import org.eclipse.emf.cdo.transaction.CDOCommitContext; +import org.eclipse.emf.cdo.transaction.CDOTransaction; +import org.eclipse.emf.cdo.transaction.CDOTransactionConflictEvent; +import org.eclipse.emf.cdo.view.CDOViewInvalidationEvent; + +import org.eclipse.net4j.util.event.IEvent; +import org.eclipse.net4j.util.om.trace.ContextTracer; + +/** + * @author Martin Fluegge + * @since 2.0 + */ +public class BasicDawnTransactionHandler extends BasicDawnListener implements IDawnTransactionHandler +{ + private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, BasicDawnTransactionHandler.class); + + public BasicDawnTransactionHandler(IDawnEditor editor) + { + super(editor); + } + + public void attachingObject(CDOTransaction transaction, CDOObject object) + { + if (TRACER.isEnabled()) + { + TRACER.format("attachingObject {0}", object); //$NON-NLS-1$ + } + editor.setDirty(); + } + + public void detachingObject(CDOTransaction transaction, CDOObject object) + { + if (TRACER.isEnabled()) + { + TRACER.format("detachingObject {0}", object); //$NON-NLS-1$ + } + + editor.setDirty(); + } + + public void modifyingObject(CDOTransaction transaction, CDOObject object, CDOFeatureDelta featureDelta) + { + if (TRACER.isEnabled()) + { + TRACER.format("modifyingObject {0}", object); //$NON-NLS-1$ + } + + editor.setDirty(); + } + + public void committingTransaction(CDOTransaction transaction, CDOCommitContext commitContext) + { // This method can be overwritten be subclasses + } + + public void committedTransaction(CDOTransaction transaction, CDOCommitContext commitContext) + { // This method can be overwritten be subclasses + } + + public void rolledBackTransaction(CDOTransaction transaction) + { // This method can be overwritten be subclasses + } + + @Override + public void handleViewInvalidationEvent(CDOViewInvalidationEvent event) + { // This method can be overwritten be subclasses + } + + @Override + public void handleTransactionConflictEvent(CDOTransactionConflictEvent event) + { // This method can be overwritten be subclasses + } + + @Override + public void handleEvent(IEvent event) + { + } +} diff --git a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/notifications/IDawnListener.java b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/notifications/IDawnListener.java index 88016109f5..53ee91b548 100644 --- a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/notifications/IDawnListener.java +++ b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/notifications/IDawnListener.java @@ -1,49 +1,49 @@ -/*
- * 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:
- * Martin Fluegge - initial API and implementation
- */
-package org.eclipse.emf.cdo.dawn.notifications;
-
-import org.eclipse.emf.cdo.transaction.CDOTransactionConflictEvent;
-import org.eclipse.emf.cdo.view.CDOViewInvalidationEvent;
-import org.eclipse.emf.cdo.view.CDOViewLocksChangedEvent;
-
-import org.eclipse.net4j.util.event.IEvent;
-import org.eclipse.net4j.util.event.IListener;
-
-/**
- * @author Martin Fluegge
- * @since 1.0
- */
-public interface IDawnListener extends IListener
-{
- /**
- * allows to react an view invalidations
- */
- public void handleViewInvalidationEvent(CDOViewInvalidationEvent event);
-
- /**
- * Allows to react on conflicts
- */
- public void handleTransactionConflictEvent(CDOTransactionConflictEvent event);
-
- /**
- * Allows the user to react on lock change notifications:
- *
- * @since 2.0
- */
- public void handleLocksChangedEvent(CDOViewLocksChangedEvent event);
-
- /**
- * This method typically will be called for unprocessed events.
- *
- * @since 2.0
- */
- public void handleEvent(IEvent event);
-}
+/* + * 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: + * Martin Fluegge - initial API and implementation + */ +package org.eclipse.emf.cdo.dawn.notifications; + +import org.eclipse.emf.cdo.transaction.CDOTransactionConflictEvent; +import org.eclipse.emf.cdo.view.CDOViewInvalidationEvent; +import org.eclipse.emf.cdo.view.CDOViewLocksChangedEvent; + +import org.eclipse.net4j.util.event.IEvent; +import org.eclipse.net4j.util.event.IListener; + +/** + * @author Martin Fluegge + * @since 1.0 + */ +public interface IDawnListener extends IListener +{ + /** + * allows to react an view invalidations + */ + public void handleViewInvalidationEvent(CDOViewInvalidationEvent event); + + /** + * Allows to react on conflicts + */ + public void handleTransactionConflictEvent(CDOTransactionConflictEvent event); + + /** + * Allows the user to react on lock change notifications: + * + * @since 2.0 + */ + public void handleLocksChangedEvent(CDOViewLocksChangedEvent event); + + /** + * This method typically will be called for unprocessed events. + * + * @since 2.0 + */ + public void handleEvent(IEvent event); +} diff --git a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/notifications/IDawnTransactionHandler.java b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/notifications/IDawnTransactionHandler.java index 9950de17ae..2724047d72 100644 --- a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/notifications/IDawnTransactionHandler.java +++ b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/notifications/IDawnTransactionHandler.java @@ -1,21 +1,21 @@ -/*
- * 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:
- * Martin Fluegge - initial API and implementation
- */
-package org.eclipse.emf.cdo.dawn.notifications;
-
-import org.eclipse.emf.cdo.transaction.CDOTransactionHandler;
-
-/**
- * @author Martin Fluegge
- * @since 2.0
- */
-public interface IDawnTransactionHandler extends CDOTransactionHandler
-{
-}
+/* + * 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: + * Martin Fluegge - initial API and implementation + */ +package org.eclipse.emf.cdo.dawn.notifications; + +import org.eclipse.emf.cdo.transaction.CDOTransactionHandler; + +/** + * @author Martin Fluegge + * @since 2.0 + */ +public interface IDawnTransactionHandler extends CDOTransactionHandler +{ +} diff --git a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/preferences/DawnRemotePreferencePage.java b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/preferences/DawnRemotePreferencePage.java index d6be877bda..f621882fec 100644 --- a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/preferences/DawnRemotePreferencePage.java +++ b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/preferences/DawnRemotePreferencePage.java @@ -1,58 +1,58 @@ -/*
- * 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:
- * Martin Fluegge - initial API and implementation
- */
-package org.eclipse.emf.cdo.dawn.preferences;
-
-import org.eclipse.emf.cdo.dawn.DawnRuntimePlugin;
-
-import org.eclipse.jface.preference.FieldEditorPreferencePage;
-import org.eclipse.jface.preference.IntegerFieldEditor;
-import org.eclipse.jface.preference.StringFieldEditor;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-/**
- * @author Martin Fluegge
- */
-public class DawnRemotePreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage
-{
-
- public DawnRemotePreferencePage()
- {
- super(GRID);
- AbstractUIPlugin pluginInstance = DawnRuntimePlugin.getDefault();
- setPreferenceStore(pluginInstance.getPreferenceStore()); // TODO generation
- setDescription("Dawn Reference Pages");
- }
-
- /**
- * Creates the field editors. Field editors are abstractions of the common GUI blocks needed to manipulate various
- * types of preferences. Each field editor knows how to save and restore itself.
- */
- @Override
- public void createFieldEditors()
- {
- addField(new StringFieldEditor(PreferenceConstants.P_SERVER_NAME, "server name:", getFieldEditorParent()));
- addField(new IntegerFieldEditor(PreferenceConstants.P_SERVER_PORT, "server port:", getFieldEditorParent()));
- addField(new StringFieldEditor(PreferenceConstants.P_REPOSITORY_NAME, "repository:", getFieldEditorParent()));
- // TODO change this to a list of repositories to allow auto connection for the clients
- addField(new StringFieldEditor(PreferenceConstants.P_PROTOCOL, "protocol:", getFieldEditorParent()));
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
- */
- public void init(IWorkbench workbench)
- {
- }
-
-}
+/* + * 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: + * Martin Fluegge - initial API and implementation + */ +package org.eclipse.emf.cdo.dawn.preferences; + +import org.eclipse.emf.cdo.dawn.DawnRuntimePlugin; + +import org.eclipse.jface.preference.FieldEditorPreferencePage; +import org.eclipse.jface.preference.IntegerFieldEditor; +import org.eclipse.jface.preference.StringFieldEditor; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPreferencePage; +import org.eclipse.ui.plugin.AbstractUIPlugin; + +/** + * @author Martin Fluegge + */ +public class DawnRemotePreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage +{ + + public DawnRemotePreferencePage() + { + super(GRID); + AbstractUIPlugin pluginInstance = DawnRuntimePlugin.getDefault(); + setPreferenceStore(pluginInstance.getPreferenceStore()); // TODO generation + setDescription("Dawn Reference Pages"); + } + + /** + * Creates the field editors. Field editors are abstractions of the common GUI blocks needed to manipulate various + * types of preferences. Each field editor knows how to save and restore itself. + */ + @Override + public void createFieldEditors() + { + addField(new StringFieldEditor(PreferenceConstants.P_SERVER_NAME, "server name:", getFieldEditorParent())); + addField(new IntegerFieldEditor(PreferenceConstants.P_SERVER_PORT, "server port:", getFieldEditorParent())); + addField(new StringFieldEditor(PreferenceConstants.P_REPOSITORY_NAME, "repository:", getFieldEditorParent())); + // TODO change this to a list of repositories to allow auto connection for the clients + addField(new StringFieldEditor(PreferenceConstants.P_PROTOCOL, "protocol:", getFieldEditorParent())); + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) + */ + public void init(IWorkbench workbench) + { + } + +} diff --git a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/preferences/PreferenceConstants.java b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/preferences/PreferenceConstants.java index d59c945070..5518270fb1 100644 --- a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/preferences/PreferenceConstants.java +++ b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/preferences/PreferenceConstants.java @@ -1,55 +1,55 @@ -/*
- * 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:
- * Martin Fluegge - initial API and implementation
- */
-package org.eclipse.emf.cdo.dawn.preferences;
-
-import org.eclipse.emf.cdo.dawn.DawnRuntimePlugin;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-
-/**
- * @author Martin Fluegge
- */
-public class PreferenceConstants
-{
-
- public static final String P_SERVER_NAME = "serverURL";
-
- public static final String P_SERVER_PORT = "serverPort";
-
- public static final String P_REPOSITORY_NAME = "repositoryName";
-
- public static final String P_PROTOCOL = "protocol";
-
- public static String getServerName()
- {
- return getPreferenceStore().getString(P_SERVER_NAME);
- }
-
- public static String getServerPort()
- {
- return getPreferenceStore().getString(P_SERVER_PORT);
- }
-
- public static String getRepositoryName()
- {
- return getPreferenceStore().getString(P_REPOSITORY_NAME);
- }
-
- public static String getProtocol()
- {
- return getPreferenceStore().getString(P_PROTOCOL);
- }
-
- private static IPreferenceStore getPreferenceStore()
- {
- return DawnRuntimePlugin.getDefault().getPreferenceStore();
- }
-}
+/* + * 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: + * Martin Fluegge - initial API and implementation + */ +package org.eclipse.emf.cdo.dawn.preferences; + +import org.eclipse.emf.cdo.dawn.DawnRuntimePlugin; + +import org.eclipse.jface.preference.IPreferenceStore; + +/** + * @author Martin Fluegge + */ +public class PreferenceConstants +{ + + public static final String P_SERVER_NAME = "serverURL"; + + public static final String P_SERVER_PORT = "serverPort"; + + public static final String P_REPOSITORY_NAME = "repositoryName"; + + public static final String P_PROTOCOL = "protocol"; + + public static String getServerName() + { + return getPreferenceStore().getString(P_SERVER_NAME); + } + + public static String getServerPort() + { + return getPreferenceStore().getString(P_SERVER_PORT); + } + + public static String getRepositoryName() + { + return getPreferenceStore().getString(P_REPOSITORY_NAME); + } + + public static String getProtocol() + { + return getPreferenceStore().getString(P_PROTOCOL); + } + + private static IPreferenceStore getPreferenceStore() + { + return DawnRuntimePlugin.getDefault().getPreferenceStore(); + } +} diff --git a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/preferences/PreferenceInitializer.java b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/preferences/PreferenceInitializer.java index 3cd61a41cd..91badbc40e 100644 --- a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/preferences/PreferenceInitializer.java +++ b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/preferences/PreferenceInitializer.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:
- * Martin Fluegge - initial API and implementation
- */
-package org.eclipse.emf.cdo.dawn.preferences;
-
-import org.eclipse.emf.cdo.dawn.DawnRuntimePlugin;
-
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-/**
- * @author Martin Fluegge
- */
-public class PreferenceInitializer extends AbstractPreferenceInitializer
-{
-
- public PreferenceInitializer()
- {
- }
-
- @Override
- public void initializeDefaultPreferences()
- {
- AbstractUIPlugin pluginInstance = DawnRuntimePlugin.getDefault();
-
- IPreferenceStore store = pluginInstance.getPreferenceStore();
- store.setDefault(PreferenceConstants.P_SERVER_NAME, "localhost");
- store.setDefault(PreferenceConstants.P_SERVER_PORT, 2036);
- store.setDefault(PreferenceConstants.P_PROTOCOL, "tcp");
- store.setDefault(PreferenceConstants.P_REPOSITORY_NAME, "repo1");
- }
-}
+/* + * 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: + * Martin Fluegge - initial API and implementation + */ +package org.eclipse.emf.cdo.dawn.preferences; + +import org.eclipse.emf.cdo.dawn.DawnRuntimePlugin; + +import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.ui.plugin.AbstractUIPlugin; + +/** + * @author Martin Fluegge + */ +public class PreferenceInitializer extends AbstractPreferenceInitializer +{ + + public PreferenceInitializer() + { + } + + @Override + public void initializeDefaultPreferences() + { + AbstractUIPlugin pluginInstance = DawnRuntimePlugin.getDefault(); + + IPreferenceStore store = pluginInstance.getPreferenceStore(); + store.setDefault(PreferenceConstants.P_SERVER_NAME, "localhost"); + store.setDefault(PreferenceConstants.P_SERVER_PORT, 2036); + store.setDefault(PreferenceConstants.P_PROTOCOL, "tcp"); + store.setDefault(PreferenceConstants.P_REPOSITORY_NAME, "repo1"); + } +} diff --git a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/resources/DawnResourceFactory.java b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/resources/DawnResourceFactory.java index 134b237488..9f7369121b 100644 --- a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/resources/DawnResourceFactory.java +++ b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/resources/DawnResourceFactory.java @@ -1,21 +1,21 @@ -/*
- * 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:
- * Martin Fluegge - initial API and implementation
- */
-package org.eclipse.emf.cdo.dawn.resources;
-
-import org.eclipse.emf.cdo.eresource.CDOResourceFactory;
-
-/**
- * @author Martin Fluegge
- */
-public interface DawnResourceFactory extends CDOResourceFactory
-{
-
-}
+/* + * 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: + * Martin Fluegge - initial API and implementation + */ +package org.eclipse.emf.cdo.dawn.resources; + +import org.eclipse.emf.cdo.eresource.CDOResourceFactory; + +/** + * @author Martin Fluegge + */ +public interface DawnResourceFactory extends CDOResourceFactory +{ + +} diff --git a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/resources/DawnWrapperResource.java b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/resources/DawnWrapperResource.java index 44bd03ced3..3b6599bdd4 100644 --- a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/resources/DawnWrapperResource.java +++ b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/resources/DawnWrapperResource.java @@ -1,23 +1,23 @@ -/*
- * 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:
- * Martin Fluegge - initial API and implementation
- */
-package org.eclipse.emf.cdo.dawn.resources;
-
-import org.eclipse.emf.cdo.eresource.CDOResource;
-
-import org.eclipse.emf.ecore.xmi.XMLResource;
-
-/**
- * @author Martin Fluegge
- */
-public interface DawnWrapperResource extends CDOResource, XMLResource
-{
-
-}
+/* + * 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: + * Martin Fluegge - initial API and implementation + */ +package org.eclipse.emf.cdo.dawn.resources; + +import org.eclipse.emf.cdo.eresource.CDOResource; + +import org.eclipse.emf.ecore.xmi.XMLResource; + +/** + * @author Martin Fluegge + */ +public interface DawnWrapperResource extends CDOResource, XMLResource +{ + +} diff --git a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/resources/impl/DawnResourceFactoryImpl.java b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/resources/impl/DawnResourceFactoryImpl.java index 52827ce99e..62fe26a674 100644 --- a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/resources/impl/DawnResourceFactoryImpl.java +++ b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/resources/impl/DawnResourceFactoryImpl.java @@ -1,30 +1,30 @@ -/*
- * 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:
- * Martin Fluegge - initial API and implementation
- */
-package org.eclipse.emf.cdo.dawn.resources.impl;
-
-import org.eclipse.emf.cdo.dawn.resources.DawnResourceFactory;
-import org.eclipse.emf.cdo.eresource.impl.CDOResourceFactoryImpl;
-import org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl;
-
-import org.eclipse.emf.common.util.URI;
-
-/**
- * @author Martin Fluegge
- */
-public class DawnResourceFactoryImpl extends CDOResourceFactoryImpl implements DawnResourceFactory
-{
- @Override
- protected CDOResourceImpl createCDOResource(URI uri)
- {
- uri = URI.createURI(uri.toString().replace("dawn:", "cdo:"));
- return new DawnWrapperResourceImpl(uri);
- }
-}
+/* + * 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: + * Martin Fluegge - initial API and implementation + */ +package org.eclipse.emf.cdo.dawn.resources.impl; + +import org.eclipse.emf.cdo.dawn.resources.DawnResourceFactory; +import org.eclipse.emf.cdo.eresource.impl.CDOResourceFactoryImpl; +import org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl; + +import org.eclipse.emf.common.util.URI; + +/** + * @author Martin Fluegge + */ +public class DawnResourceFactoryImpl extends CDOResourceFactoryImpl implements DawnResourceFactory +{ + @Override + protected CDOResourceImpl createCDOResource(URI uri) + { + uri = URI.createURI(uri.toString().replace("dawn:", "cdo:")); + return new DawnWrapperResourceImpl(uri); + } +} diff --git a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/resources/impl/DawnWrapperResourceImpl.java b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/resources/impl/DawnWrapperResourceImpl.java index 769a8b8b62..4311d85433 100644 --- a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/resources/impl/DawnWrapperResourceImpl.java +++ b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/resources/impl/DawnWrapperResourceImpl.java @@ -1,174 +1,174 @@ -/*
- * 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:
- * Martin Fluegge - initial API and implementation
- */
-package org.eclipse.emf.cdo.dawn.resources.impl;
-
-import org.eclipse.emf.cdo.dawn.resources.DawnWrapperResource;
-import org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.xmi.DOMHandler;
-import org.eclipse.emf.ecore.xmi.DOMHelper;
-import org.eclipse.emf.ecore.xml.type.AnyType;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.xml.sax.InputSource;
-
-import java.io.IOException;
-import java.io.Writer;
-import java.util.Map;
-
-/**
- * This class wrapper CDOResource and combines it with a XMLResource to avoid problems with all frameworks which are
- * internally using an XMLResource
- *
- * @author Martin Fluegge
- */
-public class DawnWrapperResourceImpl extends CDOResourceImpl implements DawnWrapperResource
-{
-
- public DawnWrapperResourceImpl(URI uri)
- {
- super(uri);
- }
-
- @Override
- public void setRoot(boolean root)
- {
- super.setRoot(root);
- }
-
- @Override
- protected void setExisting(boolean existing)
- {
- super.setExisting(existing);
-
- }
-
- /************ XML STUFF BEGIN ********************/
-
- public DOMHelper getDOMHelper()
- {
- throw new UnsupportedOperationException();
- }
-
- public Map<Object, Object> getDefaultLoadOptions()
- {
- throw new UnsupportedOperationException();
- }
-
- public Map<Object, Object> getDefaultSaveOptions()
- {
- throw new UnsupportedOperationException();
- }
-
- public Map<EObject, AnyType> getEObjectToExtensionMap()
- {
-
- throw new UnsupportedOperationException();
- }
-
- @Deprecated
- public Map<EObject, String> getEObjectToIDMap()
- {
- throw new UnsupportedOperationException();
- }
-
- public String getEncoding()
- {
- throw new UnsupportedOperationException();
- }
-
- public String getID(EObject eObject)
- {
- return getURIFragment(eObject);
- }
-
- @Deprecated
- public Map<String, EObject> getIDToEObjectMap()
- {
- throw new UnsupportedOperationException();
- }
-
- public String getPublicId()
- {
- throw new UnsupportedOperationException();
- }
-
- public String getSystemId()
- {
- throw new UnsupportedOperationException();
- }
-
- public String getXMLVersion()
- {
- throw new UnsupportedOperationException();
- }
-
- public void load(Node node, Map<?, ?> options) throws IOException
- {
- throw new UnsupportedOperationException();
- }
-
- public void load(InputSource inputSource, Map<?, ?> options) throws IOException
- {
- throw new UnsupportedOperationException();
- }
-
- public void save(Writer writer, Map<?, ?> options) throws IOException
- {
- throw new UnsupportedOperationException();
- }
-
- public Document save(Document document, Map<?, ?> options, DOMHandler handler)
- {
- throw new UnsupportedOperationException();
- }
-
- public void setDoctypeInfo(String publicId, String systemId)
- {
- throw new UnsupportedOperationException();
- }
-
- public void setEncoding(String encoding)
- {
- throw new UnsupportedOperationException();
- }
-
- public void setID(EObject eObject, String id)
- {
- throw new UnsupportedOperationException();
- }
-
- public void setUseZip(boolean useZip)
- {
- throw new UnsupportedOperationException();
- }
-
- public void setXMLVersion(String version)
- {
- throw new UnsupportedOperationException();
- }
-
- public boolean useZip()
- {
- return false;
- }
-
- /************ XML STUFF END ********************/
- @Override
- public String toString()
- {
-
- return "DawnWrapperResource (" + super.toString() + ")";
- }
-}
+/* + * 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: + * Martin Fluegge - initial API and implementation + */ +package org.eclipse.emf.cdo.dawn.resources.impl; + +import org.eclipse.emf.cdo.dawn.resources.DawnWrapperResource; +import org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.xmi.DOMHandler; +import org.eclipse.emf.ecore.xmi.DOMHelper; +import org.eclipse.emf.ecore.xml.type.AnyType; + +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.xml.sax.InputSource; + +import java.io.IOException; +import java.io.Writer; +import java.util.Map; + +/** + * This class wrapper CDOResource and combines it with a XMLResource to avoid problems with all frameworks which are + * internally using an XMLResource + * + * @author Martin Fluegge + */ +public class DawnWrapperResourceImpl extends CDOResourceImpl implements DawnWrapperResource +{ + + public DawnWrapperResourceImpl(URI uri) + { + super(uri); + } + + @Override + public void setRoot(boolean root) + { + super.setRoot(root); + } + + @Override + protected void setExisting(boolean existing) + { + super.setExisting(existing); + + } + + /************ XML STUFF BEGIN ********************/ + + public DOMHelper getDOMHelper() + { + throw new UnsupportedOperationException(); + } + + public Map<Object, Object> getDefaultLoadOptions() + { + throw new UnsupportedOperationException(); + } + + public Map<Object, Object> getDefaultSaveOptions() + { + throw new UnsupportedOperationException(); + } + + public Map<EObject, AnyType> getEObjectToExtensionMap() + { + + throw new UnsupportedOperationException(); + } + + @Deprecated + public Map<EObject, String> getEObjectToIDMap() + { + throw new UnsupportedOperationException(); + } + + public String getEncoding() + { + throw new UnsupportedOperationException(); + } + + public String getID(EObject eObject) + { + return getURIFragment(eObject); + } + + @Deprecated + public Map<String, EObject> getIDToEObjectMap() + { + throw new UnsupportedOperationException(); + } + + public String getPublicId() + { + throw new UnsupportedOperationException(); + } + + public String getSystemId() + { + throw new UnsupportedOperationException(); + } + + public String getXMLVersion() + { + throw new UnsupportedOperationException(); + } + + public void load(Node node, Map<?, ?> options) throws IOException + { + throw new UnsupportedOperationException(); + } + + public void load(InputSource inputSource, Map<?, ?> options) throws IOException + { + throw new UnsupportedOperationException(); + } + + public void save(Writer writer, Map<?, ?> options) throws IOException + { + throw new UnsupportedOperationException(); + } + + public Document save(Document document, Map<?, ?> options, DOMHandler handler) + { + throw new UnsupportedOperationException(); + } + + public void setDoctypeInfo(String publicId, String systemId) + { + throw new UnsupportedOperationException(); + } + + public void setEncoding(String encoding) + { + throw new UnsupportedOperationException(); + } + + public void setID(EObject eObject, String id) + { + throw new UnsupportedOperationException(); + } + + public void setUseZip(boolean useZip) + { + throw new UnsupportedOperationException(); + } + + public void setXMLVersion(String version) + { + throw new UnsupportedOperationException(); + } + + public boolean useZip() + { + return false; + } + + /************ XML STUFF END ********************/ + @Override + public String toString() + { + + return "DawnWrapperResource (" + super.toString() + ")"; + } +} diff --git a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/spi/DawnState.java b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/spi/DawnState.java index 3f65b27902..0fcf3ac50f 100644 --- a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/spi/DawnState.java +++ b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/spi/DawnState.java @@ -1,20 +1,20 @@ -/*
- * 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:
- * Martin Fluegge - initial API and implementation
- */
-package org.eclipse.emf.cdo.dawn.spi;
-
-/**
- * @author Martin Fluegge
- * @since 2.0
- */
-public enum DawnState
-{
- LOCKED_LOCALLY, LOCKED_REMOTELY, DIRTY, CLEAN, CONFLICT
-}
+/* + * 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: + * Martin Fluegge - initial API and implementation + */ +package org.eclipse.emf.cdo.dawn.spi; + +/** + * @author Martin Fluegge + * @since 2.0 + */ +public enum DawnState +{ + LOCKED_LOCALLY, LOCKED_REMOTELY, DIRTY, CLEAN, CONFLICT +} diff --git a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/spi/IDawnEditingSupport.java b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/spi/IDawnEditingSupport.java index 6ffc97d492..b5c58c8d23 100644 --- a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/spi/IDawnEditingSupport.java +++ b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/spi/IDawnEditingSupport.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:
- * Martin Fluegge - initial API and implementation
- */
-package org.eclipse.emf.cdo.dawn.spi;
-
-import org.eclipse.emf.cdo.view.CDOView;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * The IDawnEditingSupport is the direct connection the the Dawn Runtime. Service Providers must implement this
- * interface to react on repository changes or local data manipulation. For implementation example @see
- * org.eclipse.emf.cdo.dawn.gmf.editors.impl.DawnGMFEditorSupport.
- *
- * @author Martin Fluegge
- * @since 2.0
- */
-public interface IDawnEditingSupport
-{
- /**
- * Sets the element dirty. Implementations must ensure that all necessary operations a made to represent a dirty
- * state. E.g. display the state in the user interface.
- */
- public void setDirty(boolean dirty);
-
- /**
- * Returns the dirty state of the UI element.
- *
- * @return true if the specific parts of the model that should be reflected as dirty to the UI are dirty, else
- * otherwise.
- */
- public boolean isDirty();
-
- /**
- * Returns the CDO view that is responsible for the data represented be the IDawnEditingSupport.
- */
- public CDOView getView();
-
- /**
- * Sets the CDO view that is responsible for the data represented be the IDawnEditingSupport.
- */
- public void setView(CDOView view);
-
- /**
- * Handles all actions that must be executed when the UI element ist closed. E.g. close the related view.
- */
- public void close();
-
- /**
- * Registers the default listeners which are used to interact with the repository and the user interface.
- */
- public void registerListeners();
-
- /**
- * Implementations must process all operations that are need to provide a clean rollback. This includes the rollback
- * on the repository site and the refreshing of the user interface.
- *
- * @since 1.0
- */
- public void rollback();
-
- /**
- * Refreshes the internal components of the IDawnEditor
- *
- * @since 2.0
- */
- public void refresh();
-
- /**
- * Locks the objects
- *
- * @since 2.0
- */
- public void lockObjects(List<Object> objectsToBeLocked);
-
- /**
- * @since 2.0
- */
- public void lockObject(Object objectToBeLocked);
-
- /**
- * Unlocks the objects
- *
- * @since 2.0
- */
- public void unlockObjects(List<Object> objectsToBeLocked);
-
- /**
- * @since 2.0
- */
- public void unlockObject(Object objectToBeUnlocked);
-
- /**
- * Implementations must handle all operations which are necessary on remotely locked objects, like disabling them,
- * providing specific markers, like colors or icons, and so on.
- *
- * @since 2.0
- */
- public void handleRemoteLockChanges(Map<Object, DawnState> changedObjects);
-}
+/* + * 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: + * Martin Fluegge - initial API and implementation + */ +package org.eclipse.emf.cdo.dawn.spi; + +import org.eclipse.emf.cdo.view.CDOView; + +import java.util.List; +import java.util.Map; + +/** + * The IDawnEditingSupport is the direct connection the the Dawn Runtime. Service Providers must implement this + * interface to react on repository changes or local data manipulation. For implementation example @see + * org.eclipse.emf.cdo.dawn.gmf.editors.impl.DawnGMFEditorSupport. + * + * @author Martin Fluegge + * @since 2.0 + */ +public interface IDawnEditingSupport +{ + /** + * Sets the element dirty. Implementations must ensure that all necessary operations a made to represent a dirty + * state. E.g. display the state in the user interface. + */ + public void setDirty(boolean dirty); + + /** + * Returns the dirty state of the UI element. + * + * @return true if the specific parts of the model that should be reflected as dirty to the UI are dirty, else + * otherwise. + */ + public boolean isDirty(); + + /** + * Returns the CDO view that is responsible for the data represented be the IDawnEditingSupport. + */ + public CDOView getView(); + + /** + * Sets the CDO view that is responsible for the data represented be the IDawnEditingSupport. + */ + public void setView(CDOView view); + + /** + * Handles all actions that must be executed when the UI element ist closed. E.g. close the related view. + */ + public void close(); + + /** + * Registers the default listeners which are used to interact with the repository and the user interface. + */ + public void registerListeners(); + + /** + * Implementations must process all operations that are need to provide a clean rollback. This includes the rollback + * on the repository site and the refreshing of the user interface. + * + * @since 1.0 + */ + public void rollback(); + + /** + * Refreshes the internal components of the IDawnEditor + * + * @since 2.0 + */ + public void refresh(); + + /** + * Locks the objects + * + * @since 2.0 + */ + public void lockObjects(List<Object> objectsToBeLocked); + + /** + * @since 2.0 + */ + public void lockObject(Object objectToBeLocked); + + /** + * Unlocks the objects + * + * @since 2.0 + */ + public void unlockObjects(List<Object> objectsToBeLocked); + + /** + * @since 2.0 + */ + public void unlockObject(Object objectToBeUnlocked); + + /** + * Implementations must handle all operations which are necessary on remotely locked objects, like disabling them, + * providing specific markers, like colors or icons, and so on. + * + * @since 2.0 + */ + public void handleRemoteLockChanges(Map<Object, DawnState> changedObjects); +} diff --git a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/spi/IDawnUIElement.java b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/spi/IDawnUIElement.java index b5d46cc4a5..293ee0da51 100644 --- a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/spi/IDawnUIElement.java +++ b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/spi/IDawnUIElement.java @@ -1,27 +1,27 @@ -/*
- * 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:
- * Martin Fluegge - initial API and implementation
- */
-package org.eclipse.emf.cdo.dawn.spi;
-
-import org.eclipse.emf.cdo.dawn.editors.IDawnEditorSupport;
-import org.eclipse.emf.cdo.view.CDOView;
-
-/**
- * @author Martin Fluegge
- * @since 2.0
- */
-public interface IDawnUIElement
-{
- public CDOView getView();
-
- public void setDirty();
-
- public IDawnEditorSupport getDawnEditorSupport();
-}
+/* + * 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: + * Martin Fluegge - initial API and implementation + */ +package org.eclipse.emf.cdo.dawn.spi; + +import org.eclipse.emf.cdo.dawn.editors.IDawnEditorSupport; +import org.eclipse.emf.cdo.view.CDOView; + +/** + * @author Martin Fluegge + * @since 2.0 + */ +public interface IDawnUIElement +{ + public CDOView getView(); + + public void setDirty(); + + public IDawnEditorSupport getDawnEditorSupport(); +} diff --git a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/transaction/DawnTransactionChangeRecorder.java b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/transaction/DawnTransactionChangeRecorder.java index 98631079dd..0ea6e25aba 100644 --- a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/transaction/DawnTransactionChangeRecorder.java +++ b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/transaction/DawnTransactionChangeRecorder.java @@ -1,48 +1,48 @@ -/*
- * 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.dawn.transaction;
-
-import org.eclipse.emf.cdo.CDODeltaNotification;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.transaction.impl.InternalTransactionalEditingDomain;
-import org.eclipse.emf.transaction.impl.TransactionChangeRecorder;
-
-/**
- * @author Martin Fluegge
- */
-public class DawnTransactionChangeRecorder extends TransactionChangeRecorder
-{
- /**
- * @since 2.0
- */
- public DawnTransactionChangeRecorder(InternalTransactionalEditingDomain domain, ResourceSet rset)
- {
- super(domain, rset);
- }
-
- /**
- * @since 1.0
- */
- @Override
- public void notifyChanged(Notification notification)
- {
- if (!(notification.getOldValue() instanceof ResourceSet && notification.getNewValue() == null && notification
- .getEventType() == Notification.SET))
- {
- if (!(notification instanceof CDODeltaNotification))
- {
- super.notifyChanged(notification);
- }
- }
- }
-}
+/* + * 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.dawn.transaction; + +import org.eclipse.emf.cdo.CDODeltaNotification; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.transaction.impl.InternalTransactionalEditingDomain; +import org.eclipse.emf.transaction.impl.TransactionChangeRecorder; + +/** + * @author Martin Fluegge + */ +public class DawnTransactionChangeRecorder extends TransactionChangeRecorder +{ + /** + * @since 2.0 + */ + public DawnTransactionChangeRecorder(InternalTransactionalEditingDomain domain, ResourceSet rset) + { + super(domain, rset); + } + + /** + * @since 1.0 + */ + @Override + public void notifyChanged(Notification notification) + { + if (!(notification.getOldValue() instanceof ResourceSet && notification.getNewValue() == null && notification + .getEventType() == Notification.SET)) + { + if (!(notification instanceof CDODeltaNotification)) + { + super.notifyChanged(notification); + } + } + } +} diff --git a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/transaction/DawnTransactionalEditingDomainImpl.java b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/transaction/DawnTransactionalEditingDomainImpl.java index 674ce68892..37533cb2eb 100644 --- a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/transaction/DawnTransactionalEditingDomainImpl.java +++ b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/dawn/transaction/DawnTransactionalEditingDomainImpl.java @@ -1,50 +1,50 @@ -/*
- * 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.dawn.transaction;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.transaction.TransactionalCommandStack;
-import org.eclipse.emf.transaction.impl.TransactionChangeRecorder;
-import org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl;
-
-/**
- * @author Martin Fluegge
- */
-public class DawnTransactionalEditingDomainImpl extends TransactionalEditingDomainImpl
-{
- public DawnTransactionalEditingDomainImpl(AdapterFactory adapterFactory, ResourceSet resourceSet)
- {
- super(adapterFactory, resourceSet);
- }
-
- public DawnTransactionalEditingDomainImpl(AdapterFactory adapterFactory)
- {
- super(adapterFactory);
- }
-
- public DawnTransactionalEditingDomainImpl(AdapterFactory adapterFactory, TransactionalCommandStack stack,
- ResourceSet resourceSet)
- {
- super(adapterFactory, stack, resourceSet);
- }
-
- public DawnTransactionalEditingDomainImpl(AdapterFactory adapterFactory, TransactionalCommandStack stack)
- {
- super(adapterFactory, stack);
- }
-
- @Override
- protected TransactionChangeRecorder createChangeRecorder(ResourceSet rset)
- {
- return new DawnTransactionChangeRecorder(this, rset);
- }
-}
+/* + * 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.dawn.transaction; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.transaction.TransactionalCommandStack; +import org.eclipse.emf.transaction.impl.TransactionChangeRecorder; +import org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl; + +/** + * @author Martin Fluegge + */ +public class DawnTransactionalEditingDomainImpl extends TransactionalEditingDomainImpl +{ + public DawnTransactionalEditingDomainImpl(AdapterFactory adapterFactory, ResourceSet resourceSet) + { + super(adapterFactory, resourceSet); + } + + public DawnTransactionalEditingDomainImpl(AdapterFactory adapterFactory) + { + super(adapterFactory); + } + + public DawnTransactionalEditingDomainImpl(AdapterFactory adapterFactory, TransactionalCommandStack stack, + ResourceSet resourceSet) + { + super(adapterFactory, stack, resourceSet); + } + + public DawnTransactionalEditingDomainImpl(AdapterFactory adapterFactory, TransactionalCommandStack stack) + { + super(adapterFactory, stack); + } + + @Override + protected TransactionChangeRecorder createChangeRecorder(ResourceSet rset) + { + return new DawnTransactionChangeRecorder(this, rset); + } +} diff --git a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/internal/dawn/bundle/OM.java b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/internal/dawn/bundle/OM.java index 9fb9c8830a..435caba00a 100644 --- a/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/internal/dawn/bundle/OM.java +++ b/plugins/org.eclipse.emf.cdo.dawn/src/org/eclipse/emf/cdo/internal/dawn/bundle/OM.java @@ -1,32 +1,32 @@ -/*
- * 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:
- * Martin Fluegge - initial API and implementation
- */
-package org.eclipse.emf.cdo.internal.dawn.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;
-
-/**
- * @author Martin Fluegge
- */
-public abstract class OM
-{
- public static final String BUNDLE_ID = "org.eclipse.emf.cdo.dawn"; //$NON-NLS-1$
-
- public static final OMBundle BUNDLE = OMPlatform.INSTANCE.bundle(BUNDLE_ID, OM.class);
-
- public static final OMTracer DEBUG = BUNDLE.tracer("debug"); //$NON-NLS-1$
-
- public static final OMTracer DEBUG_OBJECT = DEBUG.tracer("object"); //$NON-NLS-1$
-
- public static final OMLogger LOG = BUNDLE.logger();
-}
+/* + * 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: + * Martin Fluegge - initial API and implementation + */ +package org.eclipse.emf.cdo.internal.dawn.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; + +/** + * @author Martin Fluegge + */ +public abstract class OM +{ + public static final String BUNDLE_ID = "org.eclipse.emf.cdo.dawn"; //$NON-NLS-1$ + + public static final OMBundle BUNDLE = OMPlatform.INSTANCE.bundle(BUNDLE_ID, OM.class); + + public static final OMTracer DEBUG = BUNDLE.tracer("debug"); //$NON-NLS-1$ + + public static final OMTracer DEBUG_OBJECT = DEBUG.tracer("object"); //$NON-NLS-1$ + + public static final OMLogger LOG = BUNDLE.logger(); +} |