Last change
on this file since 359 was
192,
checked in by sherbold, 13 years ago
|
Work on the SWT GUI prototype. The prototype is still incomplete and should not be used.
|
-
Property svn:mime-type set to
text/plain
|
File size:
872 bytes
|
Line | |
---|
1 | package de.ugoe.cs.eventbench.swt;
|
---|
2 |
|
---|
3 | import org.eclipse.swt.SWT;
|
---|
4 | import org.eclipse.swt.widgets.List;
|
---|
5 | import org.eclipse.swt.widgets.MessageBox;
|
---|
6 | import org.eclipse.swt.widgets.Shell;
|
---|
7 |
|
---|
8 | import de.ugoe.cs.util.console.CommandExecuter;
|
---|
9 |
|
---|
10 | public class SWTHelpers {
|
---|
11 |
|
---|
12 | public static boolean deleteSelectedFromStorage(final List list) {
|
---|
13 | String[] selectedStrings = list.getSelection();
|
---|
14 | if( selectedStrings.length==0 ) {
|
---|
15 | return false;
|
---|
16 | } else {
|
---|
17 | for( String selected : selectedStrings) {
|
---|
18 | String command = "deleteObject " + selected;
|
---|
19 | CommandExecuter.getInstance().exec(command);
|
---|
20 | }
|
---|
21 | return true;
|
---|
22 | }
|
---|
23 | }
|
---|
24 |
|
---|
25 | public static void noSelectionError(final Shell shell) {
|
---|
26 | MessageBox messageBox = new MessageBox(shell, SWT.ERROR);
|
---|
27 | messageBox.setMessage("No objects selected!");
|
---|
28 | messageBox.setText("Error");
|
---|
29 | messageBox.open();
|
---|
30 | }
|
---|
31 |
|
---|
32 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.