Last change
on this file since 658 was
655,
checked in by pharms, 12 years ago
|
- removed old copyright file header
|
-
Property svn:mime-type set to
text/plain
|
File size:
998 bytes
|
Rev | Line | |
---|
[526] | 1 | package de.ugoe.cs.quest.ui.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 |
|
---|
[570] | 12 | public static boolean deleteSelectedFromStorage(final List list) {
|
---|
| 13 | String[] selectedStrings = list.getSelection();
|
---|
| 14 | if (selectedStrings.length == 0) {
|
---|
| 15 | return false;
|
---|
| 16 | }
|
---|
| 17 | else {
|
---|
| 18 | for (String selected : selectedStrings) {
|
---|
| 19 | String command = "deleteObject " + selected;
|
---|
| 20 | CommandExecuter.getInstance().exec(command);
|
---|
| 21 | }
|
---|
| 22 | return true;
|
---|
| 23 | }
|
---|
| 24 | }
|
---|
| 25 |
|
---|
| 26 | public static void noSelectionError(final Shell shell) {
|
---|
| 27 | MessageBox messageBox = new MessageBox(shell, SWT.ERROR);
|
---|
| 28 | messageBox.setMessage("No objects selected!");
|
---|
| 29 | messageBox.setText("Error");
|
---|
| 30 | messageBox.open();
|
---|
| 31 | }
|
---|
| 32 |
|
---|
[526] | 33 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.