protected Button edit;
protected Button remove;
- protected Button start;
- protected Button stop;
+// protected Button start;
+// protected Button stop;
protected List selection2;
table = new Table(this, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI | SWT.FULL_SELECTION);
data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
data.widthHint = 300;
+ data.heightHint = 300;
// WorkbenchHelp.setHelp(table, ContextIds.PREF_MONITORS);
table.setLayoutData(data);
table.setLinesVisible(true);
TableLayout tableLayout = new TableLayout();
-
+
TableColumn statusColumn = new TableColumn(table, SWT.NONE);
statusColumn.setText(WikiEditorPlugin.getResource("%columnName"));
ColumnWeightData colData = new ColumnWeightData(5, 30, true);
tableLayout.addColumnData(colData);
table.setLayout(tableLayout);
-
+
tableViewer = new TableViewer(table);
tableViewer.setContentProvider(new ConfigurationContentProvider());
tableViewer.setLabelProvider(new ConfigurationTableLabelProvider());
tableViewer.setInput("root");
-
tableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
setSelection(event.getSelection());
});
remove.setEnabled(false);
- start = SWTUtil.createButton(buttonComp, WikiEditorPlugin.getResource("%start"));
- start.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- Iterator iterator = getSelection().iterator();
- while (iterator.hasNext()) {
- IConfiguration configuration = (IConfiguration) iterator.next();
+// start = SWTUtil.createButton(buttonComp, WikiEditorPlugin.getResource("%start"));
+// start.addSelectionListener(new SelectionAdapter() {
+// public void widgetSelected(SelectionEvent e) {
+// Iterator iterator = getSelection().iterator();
+// while (iterator.hasNext()) {
+// IConfiguration configuration = (IConfiguration) iterator.next();
+//// try {
+//// WikiEditorPlugin.startMonitor(monitor);
+//// } catch (CoreException ce) {
+//// MessageDialog.openError(getShell(), WikiEditorPlugin.getResource("%errorDialogTitle"), ce.getStatus().getMessage());
+//// } catch (Exception ce) {
+//// MessageDialog.openError(getShell(), WikiEditorPlugin.getResource("%errorDialogTitle"), ce.getMessage());
+//// }
+// tableViewer.refresh(configuration, true);
+// }
+// tableViewer.setSelection(tableViewer.getSelection());
+// }
+// });
+// start.setEnabled(false);
+//
+// stop = SWTUtil.createButton(buttonComp, WikiEditorPlugin.getResource("%stop"));
+// stop.addSelectionListener(new SelectionAdapter() {
+// public void widgetSelected(SelectionEvent e) {
+// Iterator iterator = getSelection().iterator();
+// while (iterator.hasNext()) {
+// IConfiguration monitor = (IConfiguration) iterator.next();
// try {
-// WikiEditorPlugin.startMonitor(monitor);
-// } catch (CoreException ce) {
-// MessageDialog.openError(getShell(), WikiEditorPlugin.getResource("%errorDialogTitle"), ce.getStatus().getMessage());
-// } catch (Exception ce) {
-// MessageDialog.openError(getShell(), WikiEditorPlugin.getResource("%errorDialogTitle"), ce.getMessage());
-// }
- tableViewer.refresh(configuration, true);
- }
- tableViewer.setSelection(tableViewer.getSelection());
- }
- });
- start.setEnabled(false);
-
- stop = SWTUtil.createButton(buttonComp, WikiEditorPlugin.getResource("%stop"));
- stop.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- Iterator iterator = getSelection().iterator();
- while (iterator.hasNext()) {
- IConfiguration monitor = (IConfiguration) iterator.next();
- try {
-// WikiEditorPlugin.stopMonitor(monitor);
- } catch (Exception ex) { }
- tableViewer.refresh(monitor, true);
- }
- tableViewer.setSelection(tableViewer.getSelection());
- }
- });
- stop.setEnabled(false);
+//// WikiEditorPlugin.stopMonitor(monitor);
+// } catch (Exception ex) { }
+// tableViewer.refresh(monitor, true);
+// }
+// tableViewer.setSelection(tableViewer.getSelection());
+// }
+// });
+// stop.setEnabled(false);
}
protected List getSelection() {
if (!selection2.isEmpty()) {
remove.setEnabled(true);
- boolean allStopped = true;
- boolean allStarted = true;
+// boolean allStopped = true;
+// boolean allStarted = true;
- iterator = selection2.iterator();
- while (iterator.hasNext()) {
- IConfiguration monitor = (IConfiguration) iterator.next();
- if (monitor.isActive())
- allStopped = false;
- else
- allStarted = false;
- }
- start.setEnabled(allStopped);
- stop.setEnabled(allStarted);
- edit.setEnabled(selection2.size() == 1 && allStopped);
+// iterator = selection2.iterator();
+// while (iterator.hasNext()) {
+// IConfiguration monitor = (IConfiguration) iterator.next();
+// if (monitor.isActive())
+// allStopped = false;
+// else
+// allStarted = false;
+// }
+// start.setEnabled(allStopped);
+// stop.setEnabled(allStarted);
+ edit.setEnabled(true);
} else {
edit.setEnabled(false);
remove.setEnabled(false);
- start.setEnabled(false);
- stop.setEnabled(false);
+// start.setEnabled(false);
+// stop.setEnabled(false);
}
}
}
\ No newline at end of file