- }
-
- @Override
- protected Control createDialogArea(Composite parent) {
- getShell().setText("Edit selector condition");
-
- Composite content = (Composite)super.createDialogArea(parent);
- GridLayoutFactory.swtDefaults().numColumns(1).applyTo(content);
-
- GridDataFactory defaultWidth = GridDataFactory.swtDefaults().hint(200, SWT.DEFAULT);
-
- // Is inverse
- inverseField = new Button(content, SWT.CHECK);
- inverseField.setText("Is inverse");
- inverseField.setSelection(isInverse);
-
- // Condition type
- typeField = new Combo(content, SWT.BORDER | SWT.READ_ONLY);
- typeField.setItems("Property value", "In region", "On route", "Combination");
- typeField.select(typeIndex);
-
- // Type-dependent stacked panels
- stackPanel = new Composite(content, SWT.NONE);
- stack = new StackLayout();
- stackPanel.setLayout(stack);
-
- // Property condition panel
- propertyPanel = new Composite(stackPanel, SWT.NONE);
- GridLayoutFactory.swtDefaults().numColumns(2).applyTo(propertyPanel);
-
- new Label(propertyPanel, SWT.NONE).setText("Property name");
- propertyNameField = new Text(propertyPanel, SWT.BORDER);
- propertyNameField.setText(propertyName);
- defaultWidth.applyTo(propertyNameField);
-
- new Label(propertyPanel, SWT.NONE).setText("Lower limit");
- lowerLimitField = new Text(propertyPanel, SWT.BORDER);
- defaultWidth.applyTo(lowerLimitField);
- if (lowerLimit != null) lowerLimitField.setText(lowerLimit.toString());
-
- new Label(propertyPanel, SWT.NONE).setText("Upper limit");
- upperLimitField = new Text(propertyPanel, SWT.BORDER);
- defaultWidth.applyTo(upperLimitField);
- if (upperLimit != null) upperLimitField.setText(upperLimit.toString());
-
- // Region condition panel
- regionPanel = new Composite(stackPanel, SWT.NONE);
- GridLayoutFactory.swtDefaults().numColumns(2).applyTo(regionPanel);
-
- new Label(regionPanel, SWT.NONE).setText("Region");
- regionField = new Combo(regionPanel, SWT.BORDER | SWT.READ_ONLY);
- regionField.setItems(regionNames);
- defaultWidth.applyTo(regionField);
-
- if (region != null) {
- int regionIndex = Arrays.indexOf(regionResources, region);
- regionField.select(regionIndex);
- }
- else {
- regionField.select(0);
- }
-
- // Route condition panel
- routePanel = new Composite(stackPanel, SWT.NONE);
- GridLayoutFactory.swtDefaults().numColumns(2).applyTo(routePanel);
-
- new Label(routePanel, SWT.NONE).setText("Route");
- routeField = new Combo(routePanel, SWT.BORDER | SWT.READ_ONLY);
- routeField.setItems(routeNames);
- defaultWidth.applyTo(routeField);
-
- if (route != null) {
- int routeIndex = Arrays.indexOf(routeResources, route);
- routeField.select(routeIndex);
- }
- else {
- routeField.select(0);
- }
-
- // Aggregate condition panel
- aggregatePanel = new Composite(stackPanel, SWT.NONE);
- GridLayoutFactory.swtDefaults().numColumns(2).applyTo(aggregatePanel);
-
- new Label(aggregatePanel, SWT.NONE).setText("Operator");
- operatorField = new Combo(aggregatePanel, SWT.READ_ONLY);
- operatorField.setItems("And", "Or");
- operatorField.select(isConjunction ? 0 : 1);
-
- new Label(aggregatePanel, SWT.NONE).setText("Sub-conditions");
- Composite buttons = new Composite(aggregatePanel, SWT.NONE);
- RowLayoutFactory.swtDefaults().justify(true).fill(true).extendedMargins(0, 0, 0, 0).type(SWT.HORIZONTAL).applyTo(buttons);