Commit fbacc92b authored by Andrey Filippov's avatar Andrey Filippov

Added parameter tooltips for the dialogs

parent 65033cd8
...@@ -58,6 +58,7 @@ public class ParamNodeReader extends AbstractConditionNodeReader { ...@@ -58,6 +58,7 @@ public class ParamNodeReader extends AbstractConditionNodeReader {
String defaultValue = XMLConfig.getAttributeValue(paramNode, XMLConfig.PARAMETER_DEFAULT_VALUE_ATTR); String defaultValue = XMLConfig.getAttributeValue(paramNode, XMLConfig.PARAMETER_DEFAULT_VALUE_ATTR);
String omitValue = XMLConfig.getAttributeValue(paramNode, XMLConfig.PARAMETER_OMIT_VALUE_ATTR); String omitValue = XMLConfig.getAttributeValue(paramNode, XMLConfig.PARAMETER_OMIT_VALUE_ATTR);
String label = XMLConfig.getAttributeValue(paramNode, XMLConfig.PARAMETER_LABEL_ATTR); String label = XMLConfig.getAttributeValue(paramNode, XMLConfig.PARAMETER_LABEL_ATTR);
String tooltip = XMLConfig.getAttributeValue(paramNode, XMLConfig.PARAMETER_TOOLTIP_ATTR);
String readOnly = XMLConfig.getAttributeValue(paramNode, XMLConfig.PARAMETER_READONLY_ATTR); String readOnly = XMLConfig.getAttributeValue(paramNode, XMLConfig.PARAMETER_READONLY_ATTR);
String visible = XMLConfig.getAttributeValue(paramNode, XMLConfig.PARAMETER_VISIBLE_ATTR); String visible = XMLConfig.getAttributeValue(paramNode, XMLConfig.PARAMETER_VISIBLE_ATTR);
if(id == null) if(id == null)
...@@ -69,6 +70,7 @@ public class ParamNodeReader extends AbstractConditionNodeReader { ...@@ -69,6 +70,7 @@ public class ParamNodeReader extends AbstractConditionNodeReader {
formatName, formatName,
defaultValue, defaultValue,
label, label,
tooltip,
omitValue, omitValue,
readOnly, readOnly,
visible, visible,
......
...@@ -76,6 +76,7 @@ public class XMLConfig extends Config { ...@@ -76,6 +76,7 @@ public class XMLConfig extends Config {
static final String PARAMETER_DEFAULT_VALUE_ATTR = "default"; static final String PARAMETER_DEFAULT_VALUE_ATTR = "default";
static final String PARAMETER_OMIT_VALUE_ATTR = "omit"; static final String PARAMETER_OMIT_VALUE_ATTR = "omit";
static final String PARAMETER_LABEL_ATTR = "label"; static final String PARAMETER_LABEL_ATTR = "label";
static final String PARAMETER_TOOLTIP_ATTR = "tooltip";
static final String PARAMETER_READONLY_ATTR = "readonly"; static final String PARAMETER_READONLY_ATTR = "readonly";
static final String PARAMETER_VISIBLE_ATTR = "visible"; static final String PARAMETER_VISIBLE_ATTR = "visible";
......
...@@ -36,6 +36,7 @@ public class Parameter implements Cloneable, Updateable { ...@@ -36,6 +36,7 @@ public class Parameter implements Cloneable, Updateable {
private String syntaxName; private String syntaxName;
private String defaultValue; private String defaultValue;
private String label; private String label;
private String tooltip;
private String omitValue; private String omitValue;
private String readonly; private String readonly;
private String visible; private String visible;
...@@ -58,6 +59,7 @@ public class Parameter implements Cloneable, Updateable { ...@@ -58,6 +59,7 @@ public class Parameter implements Cloneable, Updateable {
String syntaxName, String syntaxName,
String defaultValue, String defaultValue,
String label, String label,
String tooltip,
String omitValue, String omitValue,
String readonly, String readonly,
String visible, String visible,
...@@ -71,6 +73,7 @@ public class Parameter implements Cloneable, Updateable { ...@@ -71,6 +73,7 @@ public class Parameter implements Cloneable, Updateable {
this.syntaxName = syntaxName; this.syntaxName = syntaxName;
this.defaultValue = defaultValue; this.defaultValue = defaultValue;
this.label = label; this.label = label;
this.tooltip = tooltip;
this.omitValue = omitValue; this.omitValue = omitValue;
this.readonly = readonly; this.readonly = readonly;
this.visible = visible; this.visible = visible;
...@@ -90,6 +93,7 @@ public class Parameter implements Cloneable, Updateable { ...@@ -90,6 +93,7 @@ public class Parameter implements Cloneable, Updateable {
param.syntaxName, param.syntaxName,
param.defaultValue, param.defaultValue,
param.label, param.label,
param.tooltip,
param.omitValue, param.omitValue,
param.readonly, param.readonly,
param.visible, param.visible,
...@@ -241,6 +245,10 @@ public class Parameter implements Cloneable, Updateable { ...@@ -241,6 +245,10 @@ public class Parameter implements Cloneable, Updateable {
return label; return label;
} }
public String getToolTip() {
return tooltip;
}
public ParamType getType() { public ParamType getType() {
return type; return type;
} }
...@@ -442,6 +450,9 @@ public class Parameter implements Cloneable, Updateable { ...@@ -442,6 +450,9 @@ public class Parameter implements Cloneable, Updateable {
if(label == null) if(label == null)
label = param.label; label = param.label;
if(tooltip == null)
tooltip = param.tooltip;
if(omitValue == null) if(omitValue == null)
omitValue = param.omitValue; omitValue = param.omitValue;
......
...@@ -182,14 +182,6 @@ public class OptionsBlock { ...@@ -182,14 +182,6 @@ public class OptionsBlock {
component = new LabelComponent(param); component = new LabelComponent(param);
} else if (paramType instanceof ParamTypeNumber) { } else if (paramType instanceof ParamTypeNumber) {
component = new NumberComponent(param); component = new NumberComponent(param);
/*
Component component = null;
ParamType paramType = param.getType();
if (paramType instanceof ParamTypeNumber) {
component = new NumberComponent(param);
*/
} else if (paramType instanceof ParamTypeBool) { } else if (paramType instanceof ParamTypeBool) {
component = new BoolComponent(param); component = new BoolComponent(param);
} else if (paramType instanceof ParamTypeString) { } else if (paramType instanceof ParamTypeString) {
...@@ -244,30 +236,12 @@ public class OptionsBlock { ...@@ -244,30 +236,12 @@ public class OptionsBlock {
component = createComponent(param); component = createComponent(param);
if (component == null) if (component == null)
continue; continue;
} }
activeComponents.add(component); activeComponents.add(component);
// component.setPreferenceStore(store); // component.setPreferenceStore(store);
component.createControl(tabComposites[i]); component.createControl(tabComposites[i]);
component.setChangeListener(changeListener); component.setChangeListener(changeListener);
/*
String paramID = (String)pi.next();
Parameter param = context.findParam(paramID);
if (!param.isVisible())
continue;
Component component = components.get(param);
if (component == null)
component = createComponent(param);
if (component == null)
continue;
activeComponents.add(component);
// component.setPreferenceStore(store);
component.createControl(tabComposites[i]);
component.setChangeListener(changeListener);
*/
} }
} }
} // addProperties() } // addProperties()
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
package com.elphel.vdt.ui.options.component; package com.elphel.vdt.ui.options.component;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTException;
import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Composite;
...@@ -48,7 +49,21 @@ public class ComboComponent extends GeneralComponent { ...@@ -48,7 +49,21 @@ public class ComboComponent extends GeneralComponent {
StringBuilder sb= new StringBuilder(); StringBuilder sb= new StringBuilder();
String [] values=type.getValues(); String [] values=type.getValues();
String [] labels=type.getLabels(); String [] labels=type.getLabels();
/*
String paramTooltip=param.getToolTip();
String paramTooltip=null;
try {
paramTooltip=comboField.getToolTipText();
} catch (SWTException e){
}
if ((paramTooltip!=null) && (paramTooltip.length()>0)){
sb.append(paramTooltip);
sb.append("\n---------------------------\n");
}
*/
for (int i=0;i<type.getValues().length;i++){ for (int i=0;i<type.getValues().length;i++){
sb.append("\""); sb.append("\"");
sb.append(values[i]); sb.append(values[i]);
...@@ -59,7 +74,6 @@ public class ComboComponent extends GeneralComponent { ...@@ -59,7 +74,6 @@ public class ComboComponent extends GeneralComponent {
} }
} }
comboField.setToolTipText(sb.toString()); comboField.setToolTipText(sb.toString());
comboField.setMenu(createPopupMenu(comboField.getShell())); comboField.setMenu(createPopupMenu(comboField.getShell()));
endCreateControl(); endCreateControl();
} }
......
...@@ -79,6 +79,9 @@ public abstract class Component { ...@@ -79,6 +79,9 @@ public abstract class Component {
if (param!=null) {// Andrey - to add labels if (param!=null) {// Andrey - to add labels
labelField = createLabel(parent, param.getLabel()); labelField = createLabel(parent, param.getLabel());
labelField.setMenu(createPopupMenu(labelField.getShell())); labelField.setMenu(createPopupMenu(labelField.getShell()));
if (param.getToolTip()!=null){
labelField.setToolTipText(param.getToolTip());
}
} }
} }
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<action-menu> <action-menu>
<action label="Optimize and Place" resource="" icon="xilinx.png" /> <action label="Optimize and Place" resource="" icon="xilinx.png" />
</action-menu> </action-menu>
<parameter id="FromMemory" label="Do not load snapshot created after synthesis" <parameter id="FromMemory" tooltip="Do not load snapshot created after synthesis" label="Run from memory"
default="false" type= "Boolean" format="None"/> default="false" type= "Boolean" format="None"/>
<parameter id="SkipPreOptimization" label="Do not run pre optimization TCL commands" <parameter id="SkipPreOptimization" label="Do not run pre optimization TCL commands"
default="false" type= "Boolean" format="None"/> default="false" type= "Boolean" format="None"/>
...@@ -190,8 +190,10 @@ ...@@ -190,8 +190,10 @@
"ShowInfo" "ShowInfo"
"GrepEWI" "GrepEWI"
</group> </group>
<group name="Optimization"> <group name="Pre-optimization commands">
"PreOptTCL" "PreOptTCL"
</group>
<group name="Optimization">
"directive_opt" "directive_opt"
"retarget" "retarget"
"propconst" "propconst"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment