]>
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
1 package org
.argeo
.slc
.client
.ui
.commands
;
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
.DirectoryDialog
;
11 import org
.eclipse
.swt
.widgets
.Shell
;
14 * Command handler to manage existing bundles; add or remove specific ones.
20 public class ManageBundlesHandler
extends AbstractHandler
{
21 private static final Log log
= LogFactory
22 .getLog(ManageBundlesHandler
.class);
24 // private static final String DEFAULT_BUNDLE_DIR = "tmp";
26 public Object
execute(ExecutionEvent event
) throws ExecutionException
{
28 Shell shell
= ClientUiPlugin
.getDefault().getWorkbench()
29 .getActiveWorkbenchWindow().getShell();
30 // LaunchConfigurationsDialog lcd;
31 // see http://kickjava.com/src/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java.htm
32 // to have more ideas about what to do.
34 TitleAreaDialog tad
= new TitleAreaDialog(shell
);
35 tad
.setTitle("Manage Bundles");
38 DirectoryDialog dialog2
= new DirectoryDialog(shell
);
39 String path
= dialog2
.open();
42 // action canceled by user
44 log
.debug("Path chosen by user : " + path
);
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 |
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");
58 // final int insetX = 4, insetY = 4;
59 // FormLayout formLayout = new FormLayout();
60 // formLayout.marginWidth = insetX;
61 // formLayout.marginHeight = insetY;
62 // shell.setLayout(formLayout);
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);
70 // FormData button2Data = new FormData();
71 // button2Data.right = new FormAttachment(100, -insetX);
72 // button2Data.bottom = new FormAttachment(100, 0);
73 // button2.setLayoutData(button2Data);
75 // FormData button1Data = new FormData();
76 // button1Data.right = new FormAttachment(button2, -insetX);
77 // button1Data.bottom = new FormAttachment(100, 0);
78 // button1.setLayoutData(button1Data);
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);
90 // Display display = shell.getDisplay();
91 // while (!shell.isDisposed()) {
92 // if (!display.readAndDispatch())