* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
- *
+ �*
* Contributors:
* IBM - Initial API and implementation
**********************************************************************/
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
+
/**
- *
+ *
*/
public class ConfigurationComposite extends Composite {
protected Table table;
+
protected TableViewer tableViewer;
protected Button edit;
+
protected Button remove;
-// protected Button start;
-// protected Button stop;
+
+ // protected Button start;
+ // protected Button stop;
protected List selection2;
Label label = new Label(this, SWT.WRAP);
label.setText(PHPHelpPlugin.getResource("%configurationsList"));
- label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_CENTER));
+ label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL
+ | GridData.VERTICAL_ALIGN_CENTER));
label = new Label(this, SWT.NONE);
- 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);
+ 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);
+ // WorkbenchHelp.setHelp(table, ContextIds.PREF_MONITORS);
table.setLayoutData(data);
table.setHeaderVisible(true);
colData = new ColumnWeightData(5, 30, true);
tableLayout.addColumnData(colData);
- TableColumn urlColumn = new TableColumn(table, SWT.NONE);
- urlColumn.setText(PHPHelpPlugin.getResource("%columnUser"));
- colData = new ColumnWeightData(5, 30, true);
- tableLayout.addColumnData(colData);
+ // TableColumn urlColumn = new TableColumn(table, SWT.NONE);
+ // urlColumn.setText(PHPHelpPlugin.getResource("%columnUser"));
+ // colData = new ColumnWeightData(5, 30, true);
+ // tableLayout.addColumnData(colData);
TableColumn localColumn = new TableColumn(table, SWT.NONE);
localColumn.setText(PHPHelpPlugin.getResource("%columnURL"));
tableViewer.setContentProvider(new ConfigurationContentProvider());
tableViewer.setLabelProvider(new ConfigurationTableLabelProvider());
tableViewer.setInput("root");
- tableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- setSelection(event.getSelection());
- }
- });
+ tableViewer
+ .addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ setSelection(event.getSelection());
+ }
+ });
Composite buttonComp = new Composite(this, SWT.NONE);
layout = new GridLayout();
layout.marginHeight = 0;
layout.numColumns = 1;
buttonComp.setLayout(layout);
- data = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.VERTICAL_ALIGN_FILL);
+ data = new GridData(GridData.HORIZONTAL_ALIGN_END
+ | GridData.VERTICAL_ALIGN_FILL);
buttonComp.setLayoutData(data);
- Button add = SWTUtil.createButton(buttonComp, PHPHelpPlugin.getResource("%add"));
+ Button add = SWTUtil.createButton(buttonComp, PHPHelpPlugin
+ .getResource("%add"));
add.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
ConfigurationDialog dialog = new ConfigurationDialog(getShell());
List list = PHPHelpPlugin.getConfigurations();
Object configuration = list.get(list.size() - 1);
- tableViewer.setSelection(new StructuredSelection(configuration));
+ tableViewer
+ .setSelection(new StructuredSelection(configuration));
}
});
- edit = SWTUtil.createButton(buttonComp, PHPHelpPlugin.getResource("%edit"));
+ edit = SWTUtil.createButton(buttonComp, PHPHelpPlugin
+ .getResource("%edit"));
edit.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
IConfiguration monitor = (IConfiguration) getSelection().get(0);
IConfigurationWorkingCopy wc = monitor.getWorkingCopy();
- ConfigurationDialog dialog = new ConfigurationDialog(getShell(), wc);
+ ConfigurationDialog dialog = new ConfigurationDialog(
+ getShell(), wc);
if (dialog.open() != Window.CANCEL) {
try {
tableViewer.refresh(wc.save());
- } catch (Exception ex) { }
+ } catch (Exception ex) {
+ }
}
}
});
edit.setEnabled(false);
- remove = SWTUtil.createButton(buttonComp, PHPHelpPlugin.getResource("%remove"));
+ remove = SWTUtil.createButton(buttonComp, PHPHelpPlugin
+ .getResource("%remove"));
remove.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
Iterator iterator = getSelection().iterator();
IConfiguration monitor = (IConfiguration) iterator.next();
try {
monitor.delete();
- } catch (Exception ex) { }
+ } catch (Exception ex) {
+ }
tableViewer.remove(monitor);
List list = PHPHelpPlugin.getConfigurations();