summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-10-13 04:06:32 (EDT)
committerEike Stepper2007-10-13 04:06:32 (EDT)
commitd5848c3fe525192b5bf6039c8110422532ff28b3 (patch)
tree1cd5635929b22f8ca0902693c9d2f65cce1b9dca
parent712cff9a1093bd3dde86922b62f6138bfc5c5788 (diff)
downloadcdo-d5848c3fe525192b5bf6039c8110422532ff28b3.zip
cdo-d5848c3fe525192b5bf6039c8110422532ff28b3.tar.gz
cdo-d5848c3fe525192b5bf6039c8110422532ff28b3.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.java23
-rw-r--r--plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/actions/SashLayoutAction.java57
2 files changed, 64 insertions, 16 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 25bee43..b61041e 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
@@ -17,6 +17,7 @@ import org.eclipse.net4j.util.container.ContainerUtil;
import org.eclipse.net4j.util.container.IContainer;
import org.eclipse.net4j.util.event.IEvent;
import org.eclipse.net4j.util.ui.actions.SafeAction;
+import org.eclipse.net4j.util.ui.actions.SashLayoutAction;
import org.eclipse.net4j.util.ui.views.ContainerItemProvider;
import org.eclipse.net4j.util.ui.widgets.SashComposite;
@@ -92,24 +93,14 @@ public class CollaborationsView extends SessionManagerView
{
super.fillLocalPullDown(manager);
manager.add(new Separator());
- SafeAction verticalLayout = new SafeAction("Vertical Layout", IAction.AS_RADIO_BUTTON)
- {
- @Override
- protected void safeRun() throws Exception
- {
- sashComposite.setVertical(true);
- }
- };
+
+ SafeAction verticalLayout = new SashLayoutAction.Vertical(sashComposite);
verticalLayout.setChecked(true);
manager.add(verticalLayout);
- manager.add(new SafeAction("Horizontal Layout", IAction.AS_RADIO_BUTTON)
- {
- @Override
- protected void safeRun() throws Exception
- {
- sashComposite.setVertical(false);
- }
- });
+
+ SafeAction horizontalLayout = new SashLayoutAction.Horizontal(sashComposite);
+ horizontalLayout.setChecked(false);
+ manager.add(horizontalLayout);
}
@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
new file mode 100644
index 0000000..3a85797
--- /dev/null
+++ b/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/actions/SashLayoutAction.java
@@ -0,0 +1,57 @@
+package org.eclipse.net4j.util.ui.actions;
+
+import org.eclipse.net4j.util.ui.widgets.SashComposite;
+
+import org.eclipse.jface.action.IAction;
+
+/**
+ * @author Eike Stepper
+ */
+public abstract class SashLayoutAction extends SafeAction
+{
+ private SashComposite sashComposite;
+
+ public SashLayoutAction(SashComposite sashComposite, String text)
+ {
+ super(text, IAction.AS_RADIO_BUTTON);
+ }
+
+ public SashComposite getSashComposite()
+ {
+ return sashComposite;
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ public static class Vertical extends SashLayoutAction
+ {
+ public Vertical(SashComposite sashComposite)
+ {
+ super(sashComposite, "Vertical");
+ }
+
+ @Override
+ protected void safeRun() throws Exception
+ {
+ getSashComposite().setVertical(true);
+ }
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ public static class Horizontal extends SashLayoutAction
+ {
+ public Horizontal(SashComposite sashComposite)
+ {
+ super(sashComposite, "Horizontal");
+ }
+
+ @Override
+ protected void safeRun() throws Exception
+ {
+ getSashComposite().setVertical(false);
+ }
+ }
+} \ No newline at end of file