summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-07-23 01:27:56 (EDT)
committerEike Stepper2007-07-23 01:27:56 (EDT)
commitee027f0aea4aa28c242a703b5a129961d0864593 (patch)
tree11f8247f49789698b956f7273ca3d4212f20b359
parent1793889334b8cba607f426c808fd18ea2dd957f9 (diff)
downloadcdo-ee027f0aea4aa28c242a703b5a129961d0864593.zip
cdo-ee027f0aea4aa28c242a703b5a129961d0864593.tar.gz
cdo-ee027f0aea4aa28c242a703b5a129961d0864593.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenAuditAction.java (renamed from plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenHistoricalViewAction.java)9
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenResourceEditorAction.java (renamed from plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ShowEntryAction.java)7
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenTransactionAction.java (renamed from plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenReadOnlyViewAction.java)8
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenViewAction.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenViewEditorAction.java (renamed from plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ShowViewAction.java)6
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditorInput.java15
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOItemProvider.java39
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOTransaction.java2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java6
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAuditImpl.java2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java7
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java12
12 files changed, 73 insertions, 44 deletions
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenHistoricalViewAction.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenAuditAction.java
index 3a2420a..3971bfc 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenHistoricalViewAction.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenAuditAction.java
@@ -2,7 +2,6 @@ package org.eclipse.emf.cdo.internal.ui.actions;
import org.eclipse.emf.cdo.CDOSession;
import org.eclipse.emf.cdo.internal.ui.SharedIcons;
-import org.eclipse.emf.cdo.internal.ui.views.CDOItemProvider;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
@@ -12,12 +11,12 @@ import org.eclipse.ui.IWorkbenchPage;
/**
* @author Eike Stepper
*/
-public final class OpenHistoricalViewAction extends SessionAction
+public final class OpenAuditAction extends SessionAction
{
- public OpenHistoricalViewAction(IWorkbenchPage page, CDOSession session)
+ public OpenAuditAction(IWorkbenchPage page, CDOSession session)
{
- super(page, "Open Historical View", "Open a historical CDO view", SharedIcons
- .getDescriptor(SharedIcons.ETOOL_OPEN_EDITOR), session);
+ super(page, "Open Audit", "Open a historical CDO view", SharedIcons.getDescriptor(SharedIcons.ETOOL_OPEN_EDITOR),
+ session);
}
@Override
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ShowEntryAction.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenResourceEditorAction.java
index d611824..1b2e95f 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ShowEntryAction.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenResourceEditorAction.java
@@ -3,7 +3,6 @@ package org.eclipse.emf.cdo.internal.ui.actions;
import org.eclipse.emf.cdo.CDOView;
import org.eclipse.emf.cdo.internal.ui.editor.CDOEditor;
import org.eclipse.emf.cdo.internal.ui.views.CDOViewHistory;
-import org.eclipse.emf.cdo.internal.ui.views.CDOViewHistory.Entry;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.resource.ImageDescriptor;
@@ -12,12 +11,12 @@ import org.eclipse.ui.IWorkbenchPage;
/**
* @author Eike Stepper
*/
-public final class ShowEntryAction extends EntryAction
+public final class OpenResourceEditorAction extends EntryAction
{
- public ShowEntryAction(IWorkbenchPage page, String text, String toolTipText, ImageDescriptor image,
+ public OpenResourceEditorAction(IWorkbenchPage page, String text, String toolTipText, ImageDescriptor image,
CDOViewHistory.Entry entry)
{
- super(page, "Show Editor", "Show a CDO editor", null, entry);
+ super(page, "Open Editor", "Open a CDO editor for this resource", null, entry);
}
@Override
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenReadOnlyViewAction.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenTransactionAction.java
index f9b1f50..4a5c66b 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenReadOnlyViewAction.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenTransactionAction.java
@@ -11,17 +11,17 @@ import org.eclipse.ui.IWorkbenchPage;
/**
* @author Eike Stepper
*/
-public final class OpenReadOnlyViewAction extends SessionAction
+public final class OpenTransactionAction extends SessionAction
{
- public OpenReadOnlyViewAction(IWorkbenchPage page, CDOSession session)
+ public OpenTransactionAction(IWorkbenchPage page, CDOSession session)
{
- super(page, "Open Read-Only View", "Open a read-only CDO view", SharedIcons
+ super(page, "Open Transaction", "Open a read-write CDO view", SharedIcons
.getDescriptor(SharedIcons.ETOOL_OPEN_EDITOR), session);
}
@Override
protected void doRun(IWorkbenchPage page, IProgressMonitor monitor) throws Exception
{
- getSession().openView(new ResourceSetImpl());
+ getSession().openTransaction(new ResourceSetImpl());
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenViewAction.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenViewAction.java
index a14917c..92fec48 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenViewAction.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenViewAction.java
@@ -15,13 +15,13 @@ public final class OpenViewAction extends SessionAction
{
public OpenViewAction(IWorkbenchPage page, CDOSession session)
{
- super(page, "Open View", "Open a read-write CDO view", SharedIcons.getDescriptor(SharedIcons.ETOOL_OPEN_EDITOR),
+ super(page, "Open View", "Open a read-only CDO view", SharedIcons.getDescriptor(SharedIcons.ETOOL_OPEN_EDITOR),
session);
}
@Override
protected void doRun(IWorkbenchPage page, IProgressMonitor monitor) throws Exception
{
- getSession().openTransaction(new ResourceSetImpl());
+ getSession().openView(new ResourceSetImpl());
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ShowViewAction.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenViewEditorAction.java
index f13fed4..03e2c47 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ShowViewAction.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenViewEditorAction.java
@@ -9,11 +9,11 @@ import org.eclipse.ui.IWorkbenchPage;
/**
* @author Eike Stepper
*/
-public final class ShowViewAction extends ViewAction
+public final class OpenViewEditorAction extends ViewAction
{
- public ShowViewAction(IWorkbenchPage page, CDOView view)
+ public OpenViewEditorAction(IWorkbenchPage page, CDOView view)
{
- super(page, "Show Editor", "Show a CDO editor", null, view);
+ super(page, "Open Editor", "Open a CDO editor for this view", null, view);
}
@Override
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditorInput.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditorInput.java
index 1879e84..bee7ded 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditorInput.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditorInput.java
@@ -10,6 +10,7 @@
**************************************************************************/
package org.eclipse.emf.cdo.internal.ui.editor;
+import org.eclipse.emf.cdo.CDOAudit;
import org.eclipse.emf.cdo.CDOSession;
import org.eclipse.emf.cdo.CDOView;
import org.eclipse.emf.cdo.internal.ui.SharedIcons;
@@ -22,7 +23,7 @@ import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IPersistableElement;
-import java.util.Date;
+import java.text.MessageFormat;
/**
* @author Eike Stepper
@@ -56,7 +57,7 @@ public class CDOEditorInput extends PlatformObject implements IEditorInput
public ImageDescriptor getImageDescriptor()
{
- if (view.isHistorical())
+ if (view.isAudit())
{
return SharedIcons.getDescriptor(SharedIcons.OBJ_EDITOR_HISTORICAL);
}
@@ -105,14 +106,14 @@ public class CDOEditorInput extends PlatformObject implements IEditorInput
builder.append(view.getID());
builder.append("]");
- if (view.isHistorical())
+ if (view.isReadOnly())
{
- builder.append(" ");
- builder.append(new Date(view.getTimeStamp()));
+ builder.append(" readonly");
}
- else if (view.isReadOnly())
+
+ if (view instanceof CDOAudit)
{
- builder.append(" readonly");
+ builder.append(MessageFormat.format(" {0,date} {0,time}", ((CDOAudit)view).getTimeStamp()));
}
return builder.toString();
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOItemProvider.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOItemProvider.java
index 80e9cce..f8303a4 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOItemProvider.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOItemProvider.java
@@ -10,20 +10,22 @@
**************************************************************************/
package org.eclipse.emf.cdo.internal.ui.views;
+import org.eclipse.emf.cdo.CDOAudit;
import org.eclipse.emf.cdo.CDOSession;
-import org.eclipse.emf.cdo.CDOView;
+import org.eclipse.emf.cdo.CDOTransaction;
import org.eclipse.emf.cdo.CDOTransactionCommittedEvent;
import org.eclipse.emf.cdo.CDOTransactionDirtyEvent;
+import org.eclipse.emf.cdo.CDOView;
import org.eclipse.emf.cdo.CDOViewEvent;
import org.eclipse.emf.cdo.internal.ui.SharedIcons;
import org.eclipse.emf.cdo.internal.ui.actions.CloseSessionAction;
import org.eclipse.emf.cdo.internal.ui.actions.CloseViewAction;
import org.eclipse.emf.cdo.internal.ui.actions.CreateResourceAction;
import org.eclipse.emf.cdo.internal.ui.actions.LoadResourceAction;
-import org.eclipse.emf.cdo.internal.ui.actions.OpenHistoricalViewAction;
+import org.eclipse.emf.cdo.internal.ui.actions.OpenAuditAction;
+import org.eclipse.emf.cdo.internal.ui.actions.OpenTransactionAction;
import org.eclipse.emf.cdo.internal.ui.actions.OpenViewAction;
-import org.eclipse.emf.cdo.internal.ui.actions.OpenReadOnlyViewAction;
-import org.eclipse.emf.cdo.internal.ui.actions.ShowViewAction;
+import org.eclipse.emf.cdo.internal.ui.actions.OpenViewEditorAction;
import org.eclipse.emf.cdo.internal.ui.views.CDOViewHistory.Entry;
import org.eclipse.net4j.IConnector;
@@ -34,12 +36,11 @@ import org.eclipse.net4j.util.event.IListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ITreeSelection;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.IWorkbenchPage;
-import java.util.Date;
+import java.text.MessageFormat;
import java.util.HashMap;
import java.util.Map;
@@ -179,12 +180,22 @@ public class CDOItemProvider extends ContainerItemProvider
return connector.getURL() + "/" + repositoryName + " [" + session.getSessionID() + "]";
}
+ if (obj instanceof CDOTransaction)
+ {
+ CDOTransaction transaction = (CDOTransaction)obj;
+ return MessageFormat.format("{0}Transaction [{1}]", transaction.isDirty() ? "*" : "", transaction.getID());
+ }
+
+ if (obj instanceof CDOAudit)
+ {
+ CDOAudit audit = (CDOAudit)obj;
+ return MessageFormat.format("Audit [{0,date} {0,time}]", audit.getTimeStamp());
+ }
+
if (obj instanceof CDOView)
{
CDOView view = (CDOView)obj;
- return (view.isDirty() ? "*" : "")
- + (view.isHistorical() ? new Date(view.getTimeStamp()).toString() : view.isReadOnly() ? "View"
- : "Transaction") + " [" + view.getID() + "]";
+ return MessageFormat.format("View [{0}]", view.getID());
}
if (obj instanceof CDOViewHistory.Entry)
@@ -207,7 +218,7 @@ public class CDOItemProvider extends ContainerItemProvider
if (obj instanceof CDOView)
{
CDOView view = (CDOView)obj;
- if (view.isHistorical())
+ if (view.isAudit())
{
return SharedIcons.getImage(SharedIcons.OBJ_EDITOR_HISTORICAL);
}
@@ -247,9 +258,9 @@ public class CDOItemProvider extends ContainerItemProvider
protected void fillSession(IMenuManager manager, CDOSession session)
{
+ manager.add(new OpenTransactionAction(page, session));
manager.add(new OpenViewAction(page, session));
- manager.add(new OpenReadOnlyViewAction(page, session));
- manager.add(new OpenHistoricalViewAction(page, session));
+ manager.add(new OpenAuditAction(page, session));
manager.add(new Separator());
manager.add(new CloseSessionAction(page, session));
}
@@ -257,12 +268,12 @@ public class CDOItemProvider extends ContainerItemProvider
protected void fillView(IMenuManager manager, CDOView view)
{
manager.add(new LoadResourceAction(page, view));
- if (view.isReadWrite())
+ if (view.isTransaction())
{
manager.add(new CreateResourceAction(page, view));
}
- manager.add(new ShowViewAction(page, view));
+ manager.add(new OpenViewEditorAction(page, view));
manager.add(new Separator());
manager.add(new CloseViewAction(page, view));
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOTransaction.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOTransaction.java
index 2f313f6..3411494 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOTransaction.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOTransaction.java
@@ -31,8 +31,6 @@ public interface CDOTransaction extends CDOView
public CDOObject newInstance(CDOClass cdoClass);
- public boolean isDirty();
-
/**
* @see CDOTransaction#commit()
*/
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java
index 9f9a0fa..1cec574 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java
@@ -32,10 +32,14 @@ public interface CDOView extends INotifier
public ResourceSet getResourceSet();
- public boolean isHistorical();
+ public boolean isDirty();
+
+ public boolean isTransaction();
public boolean isReadOnly();
+ public boolean isAudit();
+
/**
* @see ResourceSet#getResource(URI, boolean)
*/
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAuditImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAuditImpl.java
index 5a99cf8..372325a 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAuditImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAuditImpl.java
@@ -36,7 +36,7 @@ public class CDOAuditImpl extends CDOViewImpl implements CDOAudit
}
@Override
- public boolean isHistorical()
+ public boolean isAudit()
{
return true;
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java
index ce2d231..ad75ae3 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java
@@ -59,12 +59,19 @@ public class CDOTransactionImpl extends CDOViewImpl implements CDOTransaction
super(id, session);
}
+ @Override
public boolean isDirty()
{
return dirty;
}
@Override
+ public boolean isTransaction()
+ {
+ return true;
+ }
+
+ @Override
public boolean isReadOnly()
{
return false;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
index b06036c..9746dcc 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
@@ -90,7 +90,12 @@ public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier
return session;
}
- public boolean isHistorical()
+ public boolean isDirty()
+ {
+ return false;
+ }
+
+ public boolean isTransaction()
{
return false;
}
@@ -100,6 +105,11 @@ public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier
return true;
}
+ public boolean isAudit()
+ {
+ return false;
+ }
+
public CDOTransactionImpl toTransaction()
{
if (this instanceof CDOTransactionImpl)