summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-07-27 01:07:04 (EDT)
committerEike Stepper2007-07-27 01:07:04 (EDT)
commit673eefec7599020953404ada882cbf797c9ef3e0 (patch)
tree505ed9e0eeb52cdb82b2fd2f8473ebc1820d7375
parent53a9642f3be80ae01221f6722de89557b503a4fe (diff)
downloadcdo-673eefec7599020953404ada882cbf797c9ef3e0.zip
cdo-673eefec7599020953404ada882cbf797c9ef3e0.tar.gz
cdo-673eefec7599020953404ada882cbf797c9ef3e0.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/ItemsProcessor.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/AbstractOpenViewAction.java26
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenAuditAction.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenTransactionAction.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenViewAction.java2
5 files changed, 33 insertions, 7 deletions
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/ItemsProcessor.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/ItemsProcessor.java
index 90a541a..cb9c106 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/ItemsProcessor.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/ItemsProcessor.java
@@ -53,7 +53,7 @@ public abstract class ItemsProcessor
{
try
{
- processCDOObject(viewer, ids, viewer.getInput());
+ processObject(viewer, ids, viewer.getInput());
processItems(viewer, ids, viewer.getTree().getItems());
}
catch (Exception ex)
@@ -76,7 +76,7 @@ public abstract class ItemsProcessor
return (CDOObject)object;
}
- if (view != null)
+ if (object != null && view != null)
{
return FSMUtil.adapt(object, view);
}
@@ -91,7 +91,7 @@ public abstract class ItemsProcessor
for (TreeItem item : items)
{
Object object = item.getData();
- processCDOObject(viewer, ids, object);
+ processObject(viewer, ids, object);
if (item.getItemCount() != 0)
{
processItems(viewer, ids, item.getItems());
@@ -99,7 +99,7 @@ public abstract class ItemsProcessor
}
}
- private void processCDOObject(TreeViewer viewer, Set<CDOID> ids, Object object)
+ private void processObject(TreeViewer viewer, Set<CDOID> ids, Object object)
{
CDOObject cdoObject = getCDOObject(object);
if (cdoObject != null)
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/AbstractOpenViewAction.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/AbstractOpenViewAction.java
new file mode 100644
index 0000000..9203ad8
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/AbstractOpenViewAction.java
@@ -0,0 +1,26 @@
+package org.eclipse.emf.cdo.internal.ui.actions;
+
+import org.eclipse.emf.cdo.CDOSession;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.IWorkbenchPage;
+
+/**
+ * @author Eike Stepper
+ */
+public abstract class AbstractOpenViewAction extends SessionAction
+{
+ private static final int NUMBER_OF_SYSTEM_PACKAGES = 2;
+
+ public AbstractOpenViewAction(IWorkbenchPage page, String text, String toolTipText, ImageDescriptor image,
+ CDOSession session)
+ {
+ super(page, text, toolTipText, image, session);
+ }
+
+ @Override
+ public boolean isEnabled()
+ {
+ return getSession().getPackageRegistry().size() > NUMBER_OF_SYSTEM_PACKAGES && super.isEnabled();
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenAuditAction.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenAuditAction.java
index d19a7d8..2cc49d9 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenAuditAction.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenAuditAction.java
@@ -11,7 +11,7 @@ import org.eclipse.ui.IWorkbenchPage;
/**
* @author Eike Stepper
*/
-public final class OpenAuditAction extends SessionAction
+public final class OpenAuditAction extends AbstractOpenViewAction
{
public OpenAuditAction(IWorkbenchPage page, CDOSession session)
{
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenTransactionAction.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenTransactionAction.java
index aa54d72..8f7eed7 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenTransactionAction.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenTransactionAction.java
@@ -11,7 +11,7 @@ import org.eclipse.ui.IWorkbenchPage;
/**
* @author Eike Stepper
*/
-public final class OpenTransactionAction extends SessionAction
+public final class OpenTransactionAction extends AbstractOpenViewAction
{
public OpenTransactionAction(IWorkbenchPage page, CDOSession session)
{
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 a199457..d3d6c89 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
@@ -11,7 +11,7 @@ import org.eclipse.ui.IWorkbenchPage;
/**
* @author Eike Stepper
*/
-public final class OpenViewAction extends SessionAction
+public final class OpenViewAction extends AbstractOpenViewAction
{
public OpenViewAction(IWorkbenchPage page, CDOSession session)
{