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 {
String defaultValue = XMLConfig.getAttributeValue(paramNode, XMLConfig.PARAMETER_DEFAULT_VALUE_ATTR);
String omitValue = XMLConfig.getAttributeValue(paramNode, XMLConfig.PARAMETER_OMIT_VALUE_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 visible = XMLConfig.getAttributeValue(paramNode, XMLConfig.PARAMETER_VISIBLE_ATTR);
if(id == null)
......@@ -69,6 +70,7 @@ public class ParamNodeReader extends AbstractConditionNodeReader {
formatName,
defaultValue,
label,
tooltip,
omitValue,
readOnly,
visible,
......
......@@ -76,6 +76,7 @@ public class XMLConfig extends Config {
static final String PARAMETER_DEFAULT_VALUE_ATTR = "default";
static final String PARAMETER_OMIT_VALUE_ATTR = "omit";
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_VISIBLE_ATTR = "visible";
......
......@@ -36,6 +36,7 @@ public class Parameter implements Cloneable, Updateable {
private String syntaxName;
private String defaultValue;
private String label;
private String tooltip;
private String omitValue;
private String readonly;
private String visible;
......@@ -58,6 +59,7 @@ public class Parameter implements Cloneable, Updateable {
String syntaxName,
String defaultValue,
String label,
String tooltip,
String omitValue,
String readonly,
String visible,
......@@ -71,6 +73,7 @@ public class Parameter implements Cloneable, Updateable {
this.syntaxName = syntaxName;
this.defaultValue = defaultValue;
this.label = label;
this.tooltip = tooltip;
this.omitValue = omitValue;
this.readonly = readonly;
this.visible = visible;
......@@ -90,6 +93,7 @@ public class Parameter implements Cloneable, Updateable {
param.syntaxName,
param.defaultValue,
param.label,
param.tooltip,
param.omitValue,
param.readonly,
param.visible,
......@@ -241,6 +245,10 @@ public class Parameter implements Cloneable, Updateable {
return label;
}
public String getToolTip() {
return tooltip;
}
public ParamType getType() {
return type;
}
......@@ -442,6 +450,9 @@ public class Parameter implements Cloneable, Updateable {
if(label == null)
label = param.label;
if(tooltip == null)
tooltip = param.tooltip;
if(omitValue == null)
omitValue = param.omitValue;
......
......@@ -182,14 +182,6 @@ public class OptionsBlock {
component = new LabelComponent(param);
} else if (paramType instanceof ParamTypeNumber) {
component = new NumberComponent(param);
/*
Component component = null;
ParamType paramType = param.getType();
if (paramType instanceof ParamTypeNumber) {
component = new NumberComponent(param);
*/
} else if (paramType instanceof ParamTypeBool) {
component = new BoolComponent(param);
} else if (paramType instanceof ParamTypeString) {
......@@ -244,30 +236,12 @@ public class OptionsBlock {
component = createComponent(param);
if (component == null)
continue;
}
activeComponents.add(component);
// component.setPreferenceStore(store);
component.createControl(tabComposites[i]);
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()
......
......@@ -18,6 +18,7 @@
package com.elphel.vdt.ui.options.component;
import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTException;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
......@@ -48,7 +49,21 @@ public class ComboComponent extends GeneralComponent {
StringBuilder sb= new StringBuilder();
String [] values=type.getValues();
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++){
sb.append("\"");
sb.append(values[i]);
......@@ -59,7 +74,6 @@ public class ComboComponent extends GeneralComponent {
}
}
comboField.setToolTipText(sb.toString());
comboField.setMenu(createPopupMenu(comboField.getShell()));
endCreateControl();
}
......
......@@ -79,6 +79,9 @@ public abstract class Component {
if (param!=null) {// Andrey - to add labels
labelField = createLabel(parent, param.getLabel());
labelField.setMenu(createPopupMenu(labelField.getShell()));
if (param.getToolTip()!=null){
labelField.setToolTipText(param.getToolTip());
}
}
}
......
......@@ -57,7 +57,7 @@
<action-menu>
<action label="Optimize and Place" resource="" icon="xilinx.png" />
</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"/>
<parameter id="SkipPreOptimization" label="Do not run pre optimization TCL commands"
default="false" type= "Boolean" format="None"/>
......@@ -190,8 +190,10 @@
"ShowInfo"
"GrepEWI"
</group>
<group name="Optimization">
<group name="Pre-optimization commands">
"PreOptTCL"
</group>
<group name="Optimization">
"directive_opt"
"retarget"
"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