本文整理汇总了Java中org.eclipse.gemoc.commons.eclipse.pde.wizards.pages.pde.ui.templates.TemplateOption.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java TemplateOption.getValue方法的具体用法?Java TemplateOption.getValue怎么用?Java TemplateOption.getValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.gemoc.commons.eclipse.pde.wizards.pages.pde.ui.templates.TemplateOption
的用法示例。
在下文中一共展示了TemplateOption.getValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getStringOption
import org.eclipse.gemoc.commons.eclipse.pde.wizards.pages.pde.ui.templates.TemplateOption; //导入方法依赖的package包/类
/**
* Returns a string value of the option with a given name. The option with
* that name must exist and must be registered as a string option to begin
* with.
*
* @param name
* the unique name of the option
* @return the string value of the option with a given name or <samp>null
* </samp> if not found.
*/
public String getStringOption(String name) {
TemplateOption option = options.get(name);
if (option != null) {
if (option instanceof StringOption) {
return ((StringOption) option).getText();
} else if (option instanceof AbstractChoiceOption) {
// This situation covers both Combos and Radio buttons
Object value = option.getValue();
if (value instanceof String) {
return (String) value;
} else if (value != null) {
return value.toString();
}
}
}
return null;
}
示例2: initializeOption
import org.eclipse.gemoc.commons.eclipse.pde.wizards.pages.pde.ui.templates.TemplateOption; //导入方法依赖的package包/类
/**
* Initializes the option with a given unique name with the provided value.
* The value will be set only if the option has not yet been initialized.
*
* @param name
* option unique name
* @param value
* the initial value of the option
*/
protected void initializeOption(String name, Object value) {
TemplateOption option = getOption(name);
if (option != null) {
// Only initialize options that have no value set
if (option.getValue() == null)
option.setValue(value);
}
}
示例3: getValue
import org.eclipse.gemoc.commons.eclipse.pde.wizards.pages.pde.ui.templates.TemplateOption; //导入方法依赖的package包/类
/**
* Returns the value of the option with a given name. The actual type of the
* returned object depends on the option type.
*
* @param name
* the name of the option
* @return the current value of the option with a specified name or
* <samp>null </samp> if not found or not applicable.
*/
public Object getValue(String name) {
TemplateOption option = options.get(name);
if (option != null)
return option.getValue();
return super.getValue(name);
}