本文整理匯總了Java中org.eclipse.ui.IMemento.getBoolean方法的典型用法代碼示例。如果您正苦於以下問題:Java IMemento.getBoolean方法的具體用法?Java IMemento.getBoolean怎麽用?Java IMemento.getBoolean使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.ui.IMemento
的用法示例。
在下文中一共展示了IMemento.getBoolean方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getBoolean
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
private boolean getBoolean(IMemento memento, String key, boolean preset) {
if (memento == null) {
return preset;
} else {
Boolean b = memento.getBoolean(key);
return b == null ? preset : b.booleanValue();
}
}
示例2: getExpandState
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
protected boolean getExpandState(IMemento memento) {
Object expandState = null;
if (getContextObject() instanceof NamedElement) {
NamedElement element = (NamedElement) getContextObject();
if (element != null)
expandState = memento.getBoolean(stripElementName(element.getName()) + IS_DEFINITION_SECTION_EXPANDED);
}
return expandState != null ? ((Boolean) expandState).booleanValue() : false;
}
示例3: getOldRepos
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
private static ArrayList<MetadataRepositoryElement> getOldRepos(final IMemento memento) {
final ArrayList<MetadataRepositoryElement> oldRepos = new ArrayList<MetadataRepositoryElement>();
try {
final IMemento xmlRepos = memento.getChild(TAG_REPOSITORIES);
for (final IMemento xmlRepo : xmlRepos.getChildren(TAG_REPOSITORY)) {
final String uriName = xmlRepo.getString(ATTR_URI);
final String nickName = xmlRepo.getString(ATTR_NICK_NAME);
final Boolean isEnabled = xmlRepo.getBoolean(ATTR_IS_ENABLED);
if (uriName != null && isEnabled != null) {
final MetadataRepositoryElement oldRepo = new MetadataRepositoryElement(null, //
new URI(uriName),
isEnabled);
if (nickName != null) {
oldRepo.setNickname(nickName);
}
oldRepos.add(oldRepo);
} else {
StatusUtil.handleStatus(String.format(
"Repository data is invalid - Nickname:%s - URI:%s - Enabled:%s", //$NON-NLS-1$
nickName,
uriName,
isEnabled), 0);
}
}
} catch (final Exception e) {
StatusUtil.handleStatus(e, 0);
}
return oldRepos;
}
示例4: getXmlBoolean
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
public static boolean getXmlBoolean(final IMemento xmlMemento, final String key, final Boolean defaultValue) {
Boolean value = xmlMemento.getBoolean(key);
if (value == null) {
value = defaultValue;
}
return value;
}