]>
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
.Shell
;
13 * Command handler to manage existing bundles; add or remove specific ones.
19 public class ManageBundlesHandler
extends AbstractHandler
{
20 private static final Log log
= LogFactory
21 .getLog(ManageBundlesHandler
.class);
23 // private static final String DEFAULT_BUNDLE_DIR = "tmp";
25 public Object
execute(ExecutionEvent event
) throws ExecutionException
{
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.
33 TitleAreaDialog tad
= new TitleAreaDialog(shell
);
34 tad
.setTitle("Manage Bundles");
38 // RCP Specific, commented for now.
39 // DirectoryDialog dialog2 = new DirectoryDialog(shell);
40 // String path = dialog2.open();
43 // // action canceled by user
45 // 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())