summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-10-13 04:17:35 (EDT)
committerEike Stepper2007-10-13 04:17:35 (EDT)
commit609466ac8226d8661b15ff5f4961e46ab2122bb3 (patch)
treee6e3b52c19683f35f9b4f3714f2eeec904adf901
parentd5848c3fe525192b5bf6039c8110422532ff28b3 (diff)
downloadcdo-609466ac8226d8661b15ff5f4961e46ab2122bb3.zip
cdo-609466ac8226d8661b15ff5f4961e46ab2122bb3.tar.gz
cdo-609466ac8226d8661b15ff5f4961e46ab2122bb3.tar.bz2
[206223] Provide collaborations example
https://bugs.eclipse.org/bugs/show_bug.cgi?id=206223
-rw-r--r--plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/CollaborationsView.java9
-rw-r--r--plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/actions/SashLayoutAction.java38
2 files changed, 39 insertions, 8 deletions
diff --git a/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/CollaborationsView.java b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/CollaborationsView.java
index b61041e..7d700e2 100644
--- a/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/CollaborationsView.java
+++ b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/CollaborationsView.java
@@ -93,14 +93,7 @@ public class CollaborationsView extends SessionManagerView
{
super.fillLocalPullDown(manager);
manager.add(new Separator());
-
- SafeAction verticalLayout = new SashLayoutAction.Vertical(sashComposite);
- verticalLayout.setChecked(true);
- manager.add(verticalLayout);
-
- SafeAction horizontalLayout = new SashLayoutAction.Horizontal(sashComposite);
- horizontalLayout.setChecked(false);
- manager.add(horizontalLayout);
+ manager.add(new SashLayoutAction.LayoutMenu(sashComposite));
}
@Override
diff --git a/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/actions/SashLayoutAction.java b/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/actions/SashLayoutAction.java
index 3a85797..7d7f50d 100644
--- a/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/actions/SashLayoutAction.java
+++ b/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/actions/SashLayoutAction.java
@@ -3,6 +3,7 @@ package org.eclipse.net4j.util.ui.actions;
import org.eclipse.net4j.util.ui.widgets.SashComposite;
import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.MenuManager;
/**
* @author Eike Stepper
@@ -54,4 +55,41 @@ public abstract class SashLayoutAction extends SafeAction
getSashComposite().setVertical(false);
}
}
+
+ /**
+ * @author Eike Stepper
+ */
+ public static class LayoutMenu extends MenuManager
+ {
+ private SafeAction verticalAction;
+
+ private SafeAction horizontalAction;
+
+ public LayoutMenu(SashComposite sashComposite)
+ {
+ this(sashComposite, true);
+ }
+
+ public LayoutMenu(SashComposite sashComposite, boolean defaultVertical)
+ {
+ super("Layout");
+ verticalAction = new SashLayoutAction.Vertical(sashComposite);
+ verticalAction.setChecked(defaultVertical);
+ add(verticalAction);
+
+ horizontalAction = new SashLayoutAction.Horizontal(sashComposite);
+ horizontalAction.setChecked(!defaultVertical);
+ add(horizontalAction);
+ }
+
+ public SafeAction getVerticalAction()
+ {
+ return verticalAction;
+ }
+
+ public SafeAction getHorizontalAction()
+ {
+ return horizontalAction;
+ }
+ }
} \ No newline at end of file