Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2014-08-08 03:25:40 -0400
committerTobias Schwarz2014-08-08 03:25:40 -0400
commit7c3967a98093b5ddca5225b3fbff005720d31ad8 (patch)
tree0c1f3a2aac840cea11000db1ecad2362055cae31
parent66d323d781b621e91102735cda188ead6a3312d3 (diff)
downloadorg.eclipse.tcf-7c3967a98093b5ddca5225b3fbff005720d31ad8.tar.gz
org.eclipse.tcf-7c3967a98093b5ddca5225b3fbff005720d31ad8.tar.xz
org.eclipse.tcf-7c3967a98093b5ddca5225b3fbff005720d31ad8.zip
Target Explorer: extend validation and content assist
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/AbstractDecoratedDialogPageControl.java15
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/RegexValidator.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/Validator.java8
3 files changed, 23 insertions, 2 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/AbstractDecoratedDialogPageControl.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/AbstractDecoratedDialogPageControl.java
index 4a2d6c2a2..aa0c2c3f2 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/AbstractDecoratedDialogPageControl.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/AbstractDecoratedDialogPageControl.java
@@ -113,7 +113,16 @@ public abstract class AbstractDecoratedDialogPageControl extends BaseDialogPageC
}
if (message == null || messageType == IMessageProvider.NONE) {
- getControlDecoration().hide();
+ if (!hasContentAssist()) {
+ getControlDecoration().hide();
+ }
+ else {
+ fieldDeco = registry.getFieldDecoration(FieldDecorationRegistry.DEC_CONTENT_PROPOSAL);
+ if (fieldDeco != null) {
+ getControlDecoration().setImage(fieldDeco.getImage());
+ getControlDecoration().show();
+ }
+ }
}
else {
getControlDecoration().show();
@@ -129,4 +138,8 @@ public abstract class AbstractDecoratedDialogPageControl extends BaseDialogPageC
public final ControlDecoration getControlDecoration() {
return controlDecoration;
}
+
+ protected boolean hasContentAssist() {
+ return false;
+ }
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/RegexValidator.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/RegexValidator.java
index 1cd95d154..245efb01e 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/RegexValidator.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/RegexValidator.java
@@ -48,7 +48,7 @@ public class RegexValidator extends Validator {
// info message when value is empty and mandatory
if (newText == null || newText.trim().length() == 0) {
- if (isAttribute(ATTR_MANDATORY)) {
+ if (isMandatory()) {
setMessage(getMessageText(INFO_MISSING_VALUE), getMessageTextType(INFO_MISSING_VALUE, INFORMATION));
return false;
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/Validator.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/Validator.java
index 3bb3b1fce..1b64aee81 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/Validator.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/Validator.java
@@ -85,6 +85,14 @@ public abstract class Validator implements IMessageProvider, ICellEditorValidato
}
/**
+ * Returns if a value is mandatory.
+ * @return
+ */
+ public boolean isMandatory() {
+ return isAttribute(ATTR_MANDATORY);
+ }
+
+ /**
* Returns true if the argument is set.
* @param attribute The argument to ask for.
* @return

Back to the top