]> git.argeo.org Git - gpl/argeo-slc.git/blob - eclipse/plugins/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/commands/ManageBundlesHandler.java
Add support for combo box in editing parameters.
[gpl/argeo-slc.git] / eclipse / plugins / org.argeo.slc.client.ui / src / main / java / org / argeo / slc / client / ui / commands / ManageBundlesHandler.java
1 package org.argeo.slc.client.ui.commands;
2
3 import org.apache.commons.logging.Log;
4 import org.apache.commons.logging.LogFactory;
5 import org.argeo.slc.client.ui.ClientUiPlugin;
6 import org.eclipse.core.commands.AbstractHandler;
7 import org.eclipse.core.commands.ExecutionEvent;
8 import org.eclipse.core.commands.ExecutionException;
9 import org.eclipse.jface.dialogs.TitleAreaDialog;
10 import org.eclipse.swt.widgets.Shell;
11
12 /**
13 * Command handler to manage existing bundles; add or remove specific ones.
14 *
15 * @author bsinou
16 *
17 */
18
19 public class ManageBundlesHandler extends AbstractHandler {
20 private static final Log log = LogFactory
21 .getLog(ManageBundlesHandler.class);
22
23 // private static final String DEFAULT_BUNDLE_DIR = "tmp";
24
25 public Object execute(ExecutionEvent event) throws ExecutionException {
26
27 Shell shell = ClientUiPlugin.getDefault().getWorkbench()
28 .getActiveWorkbenchWindow().getShell();
29 // LaunchConfigurationsDialog lcd;
30 // see http://kickjava.com/src/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java.htm
31 // to have more ideas about what to do.
32
33 TitleAreaDialog tad = new TitleAreaDialog(shell);
34 tad.setTitle("Manage Bundles");
35 tad.open();
36
37
38 // RCP Specific, commented for now.
39 // DirectoryDialog dialog2 = new DirectoryDialog(shell);
40 // String path = dialog2.open();
41 //
42 // if (path == null)
43 // // action canceled by user
44 // return null;
45 // log.debug("Path chosen by user : " + path);
46
47 // the following does not work : it doesn't display anything.
48 // Label label = new Label(shell, SWT.WRAP);
49 // label.setText("This is a long text string that will wrap when the dialog is resized.");
50 // List list = new List(shell, SWT.BORDER | SWT.H_SCROLL |
51 // SWT.V_SCROLL);
52 // list.setItems(new String[] { "Item 1", "Item 2" });
53 // Button button1 = new Button(shell, SWT.PUSH);
54 // button1.setText("OK");
55 // Button button2 = new Button(shell, SWT.PUSH);
56 // button2.setText("Cancel");
57 //
58 // final int insetX = 4, insetY = 4;
59 // FormLayout formLayout = new FormLayout();
60 // formLayout.marginWidth = insetX;
61 // formLayout.marginHeight = insetY;
62 // shell.setLayout(formLayout);
63 //
64 // Point size = label.computeSize(SWT.DEFAULT, SWT.DEFAULT);
65 // final FormData labelData = new FormData(size.x, SWT.DEFAULT);
66 // labelData.left = new FormAttachment(0, 0);
67 // labelData.right = new FormAttachment(100, 0);
68 // label.setLayoutData(labelData);
69 //
70 // FormData button2Data = new FormData();
71 // button2Data.right = new FormAttachment(100, -insetX);
72 // button2Data.bottom = new FormAttachment(100, 0);
73 // button2.setLayoutData(button2Data);
74 //
75 // FormData button1Data = new FormData();
76 // button1Data.right = new FormAttachment(button2, -insetX);
77 // button1Data.bottom = new FormAttachment(100, 0);
78 // button1.setLayoutData(button1Data);
79 //
80 // FormData listData = new FormData();
81 // listData.left = new FormAttachment(0, 0);
82 // listData.right = new FormAttachment(100, 0);
83 // listData.top = new FormAttachment(label, insetY);
84 // listData.bottom = new FormAttachment(button2, -insetY);
85 // list.setLayoutData(listData);
86 //
87 // shell.pack();
88 // shell.open();
89 //
90 // Display display = shell.getDisplay();
91 // while (!shell.isDisposed()) {
92 // if (!display.readAndDispatch())
93 // display.sleep();
94 // }
95 // display.dispose();
96
97 return null;
98 }
99
100 }