* validator updates
* script checker guidelines support.
* initial support of external checker tool
diff --git a/core/plugins/org.eclipse.dltk.validators.ui/META-INF/MANIFEST.MF b/core/plugins/org.eclipse.dltk.validators.ui/META-INF/MANIFEST.MF
index 8398ca2..82911dd 100644
--- a/core/plugins/org.eclipse.dltk.validators.ui/META-INF/MANIFEST.MF
+++ b/core/plugins/org.eclipse.dltk.validators.ui/META-INF/MANIFEST.MF
@@ -6,13 +6,12 @@
Bundle-Activator: org.eclipse.dltk.validators.internal.ui.ValidatorsUI
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
- org.eclipse.dltk.validators.core,
org.eclipse.dltk.ui,
org.eclipse.dltk.core,
org.eclipse.core.resources,
- org.eclipse.ui.console
+ org.eclipse.ui.console,
+ org.eclipse.dltk.validators.core
Eclipse-LazyStart: true
Export-Package: org.eclipse.dltk.validators
Bundle-Vendor: %providerName
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
Bundle-Localization: plugin
diff --git a/core/plugins/org.eclipse.dltk.validators.ui/plugin.xml b/core/plugins/org.eclipse.dltk.validators.ui/plugin.xml
index 9a260ef..7e4ce0a 100644
--- a/core/plugins/org.eclipse.dltk.validators.ui/plugin.xml
+++ b/core/plugins/org.eclipse.dltk.validators.ui/plugin.xml
@@ -63,5 +63,12 @@
id="org.eclipse.dltk.validators.ui.visibility">
</actionFilterTester>
</extension>
+ <extension
+ point="org.eclipse.dltk.validators.ui.validatorConfigPage">
+ <validatorConfigPage
+ class="org.eclipse.dltk.validators.internal.ui.eternalchecker.ExternalCheckerConfigurationPage"
+ id="org.eclipse.dltk.validators.core.externalChecker">
+ </validatorConfigPage>
+ </extension>
</plugin>
diff --git a/core/plugins/org.eclipse.dltk.validators.ui/schema/validatorConsoleTracker.exsd b/core/plugins/org.eclipse.dltk.validators.ui/schema/validatorConsoleTracker.exsd
index e595b7c..d9725ae 100644
--- a/core/plugins/org.eclipse.dltk.validators.ui/schema/validatorConsoleTracker.exsd
+++ b/core/plugins/org.eclipse.dltk.validators.ui/schema/validatorConsoleTracker.exsd
@@ -13,7 +13,7 @@
<element name="extension">
<complexType>
<sequence>
- <element ref="validatorConsoleTracker"/>
+ <element ref="validatorConsoleTracker" minOccurs="1" maxOccurs="unbounded"/>
</sequence>
<attribute name="point" type="string" use="required">
<annotation>
diff --git a/core/plugins/org.eclipse.dltk.validators.ui/src/org/eclipse/dltk/validators/internal/ui/AddValidatorDialog.java b/core/plugins/org.eclipse.dltk.validators.ui/src/org/eclipse/dltk/validators/internal/ui/AddValidatorDialog.java
index 4af7aac..75a5b07 100644
--- a/core/plugins/org.eclipse.dltk.validators.ui/src/org/eclipse/dltk/validators/internal/ui/AddValidatorDialog.java
+++ b/core/plugins/org.eclipse.dltk.validators.ui/src/org/eclipse/dltk/validators/internal/ui/AddValidatorDialog.java
@@ -61,7 +61,7 @@
fStati[i]= new StatusInfo();
}
- fValidatorTypes= validatorTypes;
+ fValidatorTypes= validatorTypes;
fSelectedValidatorType= editedValidator != null ? editedValidator.getValidatorType() : validatorTypes[0];
fEditedValidator = editedValidator;
@@ -99,7 +99,7 @@
}
});
}
-
+
protected String getValidatorName() {
return fValidatorName.getText();
}
@@ -111,6 +111,11 @@
fValidatorTypeCombo.doFillIntoGrid(parent, 3);
((GridData)fValidatorTypeCombo.getComboControl(null).getLayoutData()).widthHint= convertWidthInCharsToPixels(50);
+ ((GridData)fValidatorTypeCombo.getComboControl(null).getLayoutData()).grabExcessHorizontalSpace = true;
+
+
+ //((GridData)fValidatorName.getLabelControl(null).getLayoutData()).grabExcessHorizontalSpace = true;
+
fValidatorName.doFillIntoGrid(parent, 3);
@@ -177,7 +182,6 @@
fValidatorTypeCombo.setItems(getValidatorTypeNames());
if (fEditedValidator == null) {
fValidatorName.setText(""); //$NON-NLS-1$
-
} else {
fValidatorTypeCombo.setEnabled(false);
fValidatorName.setText(fEditedValidator.getName());
@@ -186,12 +190,10 @@
updateStatusLine();
}
-
-// private IValidatorType getValidatorType() {
-// return fSelectedValidatorType;
-// }
+ private IValidatorType getValidatorType() {
+ return fSelectedValidatorType;
+ }
-
private IStatus validateValidatorName() {
StatusInfo status= new StatusInfo();
String name= fValidatorName.getText();
diff --git a/core/plugins/org.eclipse.dltk.validators.ui/src/org/eclipse/dltk/validators/internal/ui/ValidatorBlock.java b/core/plugins/org.eclipse.dltk.validators.ui/src/org/eclipse/dltk/validators/internal/ui/ValidatorBlock.java
index 97e9a52..7c78808 100644
--- a/core/plugins/org.eclipse.dltk.validators.ui/src/org/eclipse/dltk/validators/internal/ui/ValidatorBlock.java
+++ b/core/plugins/org.eclipse.dltk.validators.ui/src/org/eclipse/dltk/validators/internal/ui/ValidatorBlock.java
@@ -1,4 +1,4 @@
-/*******************************************************************************
+ /*******************************************************************************
* Copyright (c) 2000, 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -186,7 +186,6 @@
/*
* (non-Javadoc)
- *
* @see org.eclipse.jface.viewers.ISelectionProvider#getSelection()
*/
public ISelection getSelection() {
@@ -556,8 +555,12 @@
*/
public boolean isDuplicateName(String name) {
for (int i = 0; i < fValidator.size(); i++) {
- IValidator Interpreter = (IValidator) fValidator.get(i);
- if (Interpreter.getName().equals(name)) {
+ IValidator validator = (IValidator) fValidator.get(i);
+ String validatorName = validator.getName();
+ if( validatorName == null ) {
+ return true;
+ }
+ if (validatorName.equals(name)) {
return true;
}
}
diff --git a/core/plugins/org.eclipse.dltk.validators.ui/src/org/eclipse/dltk/validators/internal/ui/ValidatorMessages.java b/core/plugins/org.eclipse.dltk.validators.ui/src/org/eclipse/dltk/validators/internal/ui/ValidatorMessages.java
index 76ad2cd..b53fc4f 100644
--- a/core/plugins/org.eclipse.dltk.validators.ui/src/org/eclipse/dltk/validators/internal/ui/ValidatorMessages.java
+++ b/core/plugins/org.eclipse.dltk.validators.ui/src/org/eclipse/dltk/validators/internal/ui/ValidatorMessages.java
@@ -76,9 +76,6 @@
public static String statusFetchingLibs;
public static String AddValidatorDialog_iArgs;
-
-
-
private ValidatorMessages() {
// dont instatiate
}
diff --git a/core/plugins/org.eclipse.dltk.validators.ui/src/org/eclipse/dltk/validators/internal/ui/ValidatorMessages.properties b/core/plugins/org.eclipse.dltk.validators.ui/src/org/eclipse/dltk/validators/internal/ui/ValidatorMessages.properties
index 3eeeabe..bf05395 100644
--- a/core/plugins/org.eclipse.dltk.validators.ui/src/org/eclipse/dltk/validators/internal/ui/ValidatorMessages.properties
+++ b/core/plugins/org.eclipse.dltk.validators.ui/src/org/eclipse/dltk/validators/internal/ui/ValidatorMessages.properties
@@ -75,7 +75,7 @@
ValidatorUpdater_0=Save Validator Definitions
ValidatorLibraryBlock_0=Source attachment:
-I#nterpreterLibraryBlock_1=(none)
+#InterpreterLibraryBlock_1=(none)
ValidatorLibraryBlock_10=Library Selection
#ValidatorDetailsDialog_0=Validator Details
ValidatorLibraryBlock_4=U&p
@@ -85,7 +85,7 @@
#ValidatorLibraryBlock_8=Ed&it...
ValidatorLibraryBlock_9=&Restore Default
LibraryStandin_0=System library does not exist: {0}
-LibraryStandin_1=Source attachment does not exist: {0}
+#LibraryStandin_1=Source attachment does not exist: {0}
ValidatorPreferencePage_addValidator=Add Validator, if you want to launch anything
diff --git a/core/plugins/org.eclipse.dltk.validators.ui/src/org/eclipse/dltk/validators/internal/ui/eternalchecker/AddRuleDialog.java b/core/plugins/org.eclipse.dltk.validators.ui/src/org/eclipse/dltk/validators/internal/ui/eternalchecker/AddRuleDialog.java
new file mode 100644
index 0000000..c4513fc
--- /dev/null
+++ b/core/plugins/org.eclipse.dltk.validators.ui/src/org/eclipse/dltk/validators/internal/ui/eternalchecker/AddRuleDialog.java
@@ -0,0 +1,41 @@
+package org.eclipse.dltk.validators.internal.ui.eternalchecker;
+
+import org.eclipse.dltk.internal.ui.wizards.dialogfields.StringDialogField;
+import org.eclipse.jface.dialogs.StatusDialog;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+
+import sun.text.normalizer.CharTrie.FriendAgent;
+
+public class AddRuleDialog extends StatusDialog {
+
+ private StringDialogField fRule;
+
+ public AddRuleDialog(Shell shell){
+ super(shell);
+
+ System.out.println("Dialog created");
+ }
+
+ public void create(){
+ super.create();
+ fRule.setFocus();
+ }
+
+ protected Control createDialogArea(Composite ancestor){
+ Composite parent = (Composite)super.createDialogArea(ancestor);
+ ((GridLayout)parent.getLayout()).numColumns= 3;
+
+ fRule = new StringDialogField();
+ fRule.doFillIntoGrid(parent, 3);
+
+ return parent;
+ }
+
+
+
+
+
+}
diff --git a/core/plugins/org.eclipse.dltk.validators.ui/src/org/eclipse/dltk/validators/internal/ui/eternalchecker/CheckerOutputRulesConfigurationPage.java b/core/plugins/org.eclipse.dltk.validators.ui/src/org/eclipse/dltk/validators/internal/ui/eternalchecker/CheckerOutputRulesConfigurationPage.java
new file mode 100644
index 0000000..8ff78b2
--- /dev/null
+++ b/core/plugins/org.eclipse.dltk.validators.ui/src/org/eclipse/dltk/validators/internal/ui/eternalchecker/CheckerOutputRulesConfigurationPage.java
@@ -0,0 +1,59 @@
+package org.eclipse.dltk.validators.internal.ui.eternalchecker;
+
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+public class CheckerOutputRulesConfigurationPage
+ extends PreferencePage implements IWorkbenchPreferencePage {
+
+ private ParseRuleBlock fRulesBlock;
+
+ public CheckerOutputRulesConfigurationPage(){
+ super();
+ }
+
+ public void init(IWorkbench workbench){
+
+ }
+ protected Control createContents(Composite ancestor) {
+ initializeDialogUnits(ancestor);
+
+ noDefaultAndApplyButton();
+
+ GridLayout layout= new GridLayout();
+ layout.numColumns= 1;
+ layout.marginHeight = 0;
+ layout.marginWidth = 0;
+ ancestor.setLayout(layout);
+
+ fRulesBlock = createRulesBlock();
+ fRulesBlock.createControl(ancestor);
+ Control control = fRulesBlock.getControl();
+ GridData data = new GridData(GridData.FILL_BOTH);
+ data.horizontalSpan = 1;
+ control.setLayoutData(data);
+
+ //fRulesBlock.restoreColumnSettings(ValidatorsUI.getDefault().getDialogSettings(),
+ // null);
+
+ fRulesBlock.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ }
+ });
+ applyDialogFont(ancestor);
+ return ancestor;
+
+ }
+
+ private ParseRuleBlock createRulesBlock() {
+ return new ParseRuleBlock();
+ }
+
+}
diff --git a/core/plugins/org.eclipse.dltk.validators.ui/src/org/eclipse/dltk/validators/internal/ui/eternalchecker/ExternalCheckerConfigurationPage.java b/core/plugins/org.eclipse.dltk.validators.ui/src/org/eclipse/dltk/validators/internal/ui/eternalchecker/ExternalCheckerConfigurationPage.java
new file mode 100644
index 0000000..30d8563
--- /dev/null
+++ b/core/plugins/org.eclipse.dltk.validators.ui/src/org/eclipse/dltk/validators/internal/ui/eternalchecker/ExternalCheckerConfigurationPage.java
@@ -0,0 +1,207 @@
+package org.eclipse.dltk.validators.internal.ui.eternalchecker;
+
+import org.eclipse.dltk.internal.ui.util.SWTUtil;
+import org.eclipse.dltk.internal.ui.util.TableLayoutComposite;
+import org.eclipse.dltk.internal.ui.wizards.dialogfields.StringDialogField;
+import org.eclipse.dltk.ui.util.PixelConverter;
+import org.eclipse.dltk.validators.ValidatorConfigurationPage;
+import org.eclipse.dltk.validators.internal.core.externalchecker.ExternalChecker;
+import org.eclipse.dltk.validators.internal.ui.ValidatorMessages;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTableViewer;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+
+public class ExternalCheckerConfigurationPage extends
+ ValidatorConfigurationPage {
+
+ private StringDialogField fArguments;
+ private StringDialogField fCommannd;
+ protected CheckboxTableViewer fValidatorList;
+ private Table fTable;
+ private Button addRuleButtton;
+ private StringDialogField fSyntax;
+ private StringDialogField fSyntax2;
+
+
+ public class RuleContentProvider{
+
+ }
+
+ public ExternalCheckerConfigurationPage() {
+ }
+
+ public void applyChanges() {
+ ExternalChecker externalChecker = getExtrenalChecker();
+ externalChecker.setArguments(this.fArguments.getText());
+ externalChecker.setCommand(this.fCommannd.getText());
+
+ }
+
+ public void createControl(final Composite ancestor, int columns ) {
+ createFields();
+
+ Composite parent = new Composite(ancestor, SWT.NULL);
+ GridLayout layout = (GridLayout)ancestor.getLayout();
+ // GridLayout layout = new GridLayout();
+ // layout.numColumns = columns;
+ // layout.marginHeight = 0;
+ // layout.marginWidth = 0;
+
+ Font font = ancestor.getFont();
+// parent.setFont(font);
+ parent.setLayout(layout);
+
+ GridData data =new GridData();
+
+ Label tableLabel = new Label(parent, SWT.NONE);
+ tableLabel.setText(ValidatorMessages.InstalledValidatorBlock_15);
+ data.horizontalSpan = 3;
+
+ tableLabel.setLayoutData(data);
+ tableLabel.setFont(font);
+
+ PixelConverter conv = new PixelConverter(parent);
+ data = new GridData(GridData.FILL_BOTH);
+ data.widthHint = conv.convertWidthInCharsToPixels(50);
+ TableLayoutComposite tblComposite = new TableLayoutComposite(parent,
+ SWT.NONE);
+ tblComposite.setLayoutData(data);
+ fTable = new Table(tblComposite, SWT.CHECK | SWT.BORDER | SWT.MULTI
+ | SWT.FULL_SELECTION);
+
+ data = new GridData(GridData.FILL_BOTH);
+ data.widthHint = 450;
+ fTable.setLayoutData(data);
+ fTable.setFont(font);
+
+ fTable.setHeaderVisible(true);
+ fTable.setLinesVisible(true);
+
+ TableColumn column1 = new TableColumn(fTable, SWT.NULL);
+ column1.setText("Hello");
+ column1.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ }
+ });
+
+
+ fValidatorList = new CheckboxTableViewer(fTable);
+ // fValidatorList.setLabelProvider(new ValidatorLabelProvider());
+ // fValidatorList.setContentProvider(new ValidatorContentProvider());
+ fValidatorList.addCheckStateListener(new ICheckStateListener() {
+ public void checkStateChanged(CheckStateChangedEvent event) {
+ }
+ });
+
+
+ fValidatorList
+ .addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent evt) {
+ }
+ });
+ fValidatorList.addDoubleClickListener(new IDoubleClickListener() {
+ public void doubleClick(DoubleClickEvent e) {
+ }
+ });
+ fTable.addKeyListener(new KeyAdapter() {
+ public void keyPressed(KeyEvent event) {
+ }
+ });
+
+ addRuleButtton = SWTUtil.createPushButton(ancestor,"AddRule" ,null);
+ addRuleButtton.addListener(SWT.Selection, new Listener(){
+ public void handleEvent(Event ev){
+ addRule(new Composite(ancestor, SWT.NULL));
+ }
+
+ });
+
+ // this.fCommannd.doFillIntoGrid(parent, columns);
+/// this.fArguments.doFillIntoGrid(parent, columns);
+
+ this.fSyntax.doFillIntoGrid(parent, columns);
+ this.fSyntax2.doFillIntoGrid(parent, columns);
+
+// updateValuesFrom();
+ }
+ private ExternalChecker getExtrenalChecker() {
+ return (ExternalChecker)getValidator();
+
+ }
+ private void updateValuesFrom() {
+ ExternalChecker externalChecker = getExtrenalChecker();
+ this.fArguments.setText(externalChecker.getArguments());
+ this.fCommannd.setText(externalChecker.getCommand());
+
+ }
+
+// private void createLabel(Composite parent, String content, int columns) {
+// Label l = new Label( parent, SWT.None );
+// l.setText(content);
+// GridData gd= new GridData();
+// gd.horizontalAlignment= GridData.FILL;
+// gd.grabExcessHorizontalSpace= true;
+// gd.horizontalSpan= columns;
+// l.setLayoutData(gd);
+// }
+
+// private void createBrowseButton(final Composite parent, int columns ) {/
+// GridData gd= new GridData();
+// gd.horizontalAlignment= GridData.FILL;
+// gd.grabExcessHorizontalSpace= true;
+// gd.horizontalSpan= columns - 2;
+
+// Button browse = new Button(parent, SWT.PUSH);
+// browse.setText("Browse...");
+// gd= new GridData(GridData.END);
+// gd.horizontalSpan = 1;
+// browse.setLayoutData(gd);
+
+// browse.addSelectionListener(new SelectionAdapter() {
+// public void widgetSelected(SelectionEvent e) {
+// FileDialog dialog = new FileDialog(parent.getShell(), SWT.OPEN);
+// String file = dialog.open();
+// if (file != null) {
+//// fPath.setText(file);
+// }
+// }
+// });
+// }
+ private void createFields() {
+ this.fSyntax = new StringDialogField();
+ this.fSyntax.setLabelText("Syntaz");
+
+ this.fSyntax2 = new StringDialogField();
+ this.fSyntax2.setLabelText("Syntaz");
+
+ this.fCommannd = new StringDialogField();
+ this.fCommannd.setLabelText("command to run checker");
+ this.fArguments = new StringDialogField();
+ this.fArguments.setLabelText("Arguments");
+ }
+
+ public void addRule(Control control){
+
+ AddRuleDialog addDialog = new AddRuleDialog(control.getShell());
+ }
+}
diff --git a/core/plugins/org.eclipse.dltk.validators.ui/src/org/eclipse/dltk/validators/internal/ui/eternalchecker/ParseRuleBlock.java b/core/plugins/org.eclipse.dltk.validators.ui/src/org/eclipse/dltk/validators/internal/ui/eternalchecker/ParseRuleBlock.java
new file mode 100644
index 0000000..d3e0a3d
--- /dev/null
+++ b/core/plugins/org.eclipse.dltk.validators.ui/src/org/eclipse/dltk/validators/internal/ui/eternalchecker/ParseRuleBlock.java
@@ -0,0 +1,181 @@
+package org.eclipse.dltk.validators.internal.ui.eternalchecker;
+
+
+import org.eclipse.dltk.internal.ui.util.TableLayoutComposite;
+import org.eclipse.dltk.ui.util.PixelConverter;
+import org.eclipse.dltk.validators.core.IValidator;
+import org.eclipse.dltk.validators.internal.ui.ValidatorMessages;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTableViewer;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+
+public class ParseRuleBlock implements ISelectionProvider {
+
+ protected CheckboxTableViewer fRulesList;
+ private Composite fControl;
+ private Table fTable;
+// private Button fAddButton;
+// private Button fRemoveButton;
+// private Button fEditButton;
+
+ public ParseRuleBlock(){
+
+ }
+
+ public void addSelectionChangedListener(ISelectionChangedListener listener) {
+
+ }
+
+ public ISelection getSelection() {
+ return null;
+ }
+
+ public void removeSelectionChangedListener(
+ ISelectionChangedListener listener) {
+
+ }
+
+ public void setSelection(ISelection selection) {
+
+ }
+
+ public void createControl(Composite ancestor) {
+
+ Composite parent = new Composite(ancestor, SWT.NULL);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ layout.marginHeight = 0;
+ layout.marginWidth = 0;
+
+ Font font = ancestor.getFont();
+ parent.setFont(font);
+ parent.setLayout(layout);
+
+ fControl = parent;
+
+ GridData data;
+
+ Label tableLabel = new Label(parent, SWT.NONE);
+ tableLabel.setText(ValidatorMessages.InstalledValidatorBlock_15);
+ data = new GridData();
+ data.horizontalSpan = 2;
+ tableLabel.setLayoutData(data);
+ tableLabel.setFont(font);
+
+ PixelConverter conv = new PixelConverter(parent);
+ data = new GridData(GridData.FILL_BOTH);
+ data.widthHint = conv.convertWidthInCharsToPixels(50);
+ TableLayoutComposite tblComposite = new TableLayoutComposite(parent,
+ SWT.NONE);
+ tblComposite.setLayoutData(data);
+ fTable = new Table(tblComposite, SWT.CHECK | SWT.BORDER | SWT.MULTI
+ | SWT.FULL_SELECTION);
+
+ data = new GridData(GridData.FILL_BOTH);
+ data.widthHint = 450;
+ fTable.setLayoutData(data);
+ fTable.setFont(font);
+
+ fTable.setHeaderVisible(true);
+ fTable.setLinesVisible(true);
+
+ TableColumn column1 = new TableColumn(fTable, SWT.NULL);
+ column1.setText(ValidatorMessages.InstalledValidatorBlock_0);
+ column1.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ }
+ });
+
+ TableColumn column2 = new TableColumn(fTable, SWT.NULL);
+ column2.setText(ValidatorMessages.InstalledValidatorBlock_2);
+ column2.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ }
+ });
+
+ TableColumn column3 = new TableColumn(fTable, SWT.NULL);
+ column3.setText(ValidatorMessages.InstalledValidatorBlock_1);
+ // column3.addSelectionListener(new SelectionAdapter() {
+ // public void widgetSelected(SelectionEvent e) {
+ // sortByLocation();
+ // }
+ // });
+
+ fRulesList = new CheckboxTableViewer(fTable);
+ //fRulesList.setLabelProvider(new ValidatorLabelProvider());
+ //fRulesList.setContentProvider(new ValidatorContentProvider());
+ fRulesList.addCheckStateListener(new ICheckStateListener() {
+ public void checkStateChanged(CheckStateChangedEvent event) {
+ IValidator validator = (IValidator)event.getElement();
+ validator.setActive(event.getChecked());
+ }
+ });
+
+ // by default, sort by name
+
+ fRulesList
+ .addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent evt) {
+ }
+ });
+
+ // fValidatorList.addCheckStateListener(new ICheckStateListener() {
+ // public void checkStateChanged(CheckStateChangedEvent event) {
+ // if (event.getChecked()) {
+ // setCheckedInterpreter((IValidator)event.getElement());
+ // } else {
+ // setCheckedInterpreter(null);
+ // }
+ // }
+ // });
+
+ fTable.addKeyListener(new KeyAdapter() {
+ public void keyPressed(KeyEvent event) {
+ if (event.character == SWT.DEL && event.stateMask == 0) {
+ }
+ }
+ });
+
+ Composite buttons = new Composite(parent, SWT.NULL);
+ buttons.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
+ layout = new GridLayout();
+ layout.marginHeight = 0;
+ layout.marginWidth = 0;
+ buttons.setLayout(layout);
+ buttons.setFont(font);
+
+
+
+ // copied from ListDialogField.CreateSeparator()
+ Label separator = new Label(buttons, SWT.NONE);
+ separator.setVisible(false);
+ GridData gd = new GridData();
+ gd.horizontalAlignment = GridData.FILL;
+ gd.verticalAlignment = GridData.BEGINNING;
+ gd.heightHint = 4;
+ separator.setLayoutData(gd);
+
+ }
+
+ public Control getControl() {
+ return fControl;
+ }
+
+}