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