本文整理汇总了Java中org.eclipse.jface.dialogs.IDialogSettings.getSections方法的典型用法代码示例。如果您正苦于以下问题:Java IDialogSettings.getSections方法的具体用法?Java IDialogSettings.getSections怎么用?Java IDialogSettings.getSections使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.dialogs.IDialogSettings
的用法示例。
在下文中一共展示了IDialogSettings.getSections方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getStatistics
import org.eclipse.jface.dialogs.IDialogSettings; //导入方法依赖的package包/类
public static StoredDialogStatistics[] getStatistics() {
final IDialogSettings settings = TFSCommonUIClientPlugin.getDefault().getDialogSettings();
final IDialogSettings[] sections = settings.getSections();
final List statistics = new ArrayList();
if (sections != null) {
for (int i = 0; i < sections.length; i++) {
statistics.add(createStatistics(sections[i]));
}
}
return (StoredDialogStatistics[]) statistics.toArray(new StoredDialogStatistics[] {});
}
示例2: load
import org.eclipse.jface.dialogs.IDialogSettings; //导入方法依赖的package包/类
public static GroupSet load() {
final GroupSet columnGroups = new GroupSet();
try {
final IDialogSettings settings = new DialogSettings("column_group_list");
String database = settings.get("database");
if (database == null) {
database = DBManagerFactory.getAllDBList().get(0);
}
columnGroups.setDatabase(database);
final String path = getPath();
final File columnGroupListFile = new File(path);
if (columnGroupListFile.exists()) {
settings.load(path);
final UniqueWordDictionary dictionary = new UniqueWordDictionary();
for (final IDialogSettings columnGroupSection : settings.getSections()) {
final ColumnGroup columnGroup = new ColumnGroup();
columnGroup.setGroupName(columnGroupSection.get("group_name"));
for (final IDialogSettings columnSection : columnGroupSection.getSections()) {
final String physicalName = columnSection.get("physical_name");
final String logicalName = columnSection.get("logical_name");
final SqlType sqlType = SqlType.valueOfId(columnSection.get("type"));
final String defaultValue = columnSection.get("default_value");
final String description = columnSection.get("description");
final String constraint = columnSection.get("constraint");
final boolean notNull = Boolean.valueOf(columnSection.get("not_null")).booleanValue();
final boolean unique = Boolean.valueOf(columnSection.get("unique")).booleanValue();
final Integer length = toInteger(columnSection.get("length"));
final Integer decimal = toInteger(columnSection.get("decimal"));
final boolean array = Boolean.valueOf(columnSection.get("array")).booleanValue();
final Integer arrayDimension = toInteger(columnSection.get("array_dimension"));
final boolean unsigned = Boolean.valueOf(columnSection.get("unsigned")).booleanValue();
final boolean zerofill = Boolean.valueOf(columnSection.get("zerofill")).booleanValue();
final boolean binary = Boolean.valueOf(columnSection.get("binary")).booleanValue();
final String args = columnSection.get("args");
final boolean charSemantics = Boolean.valueOf(columnSection.get("char_semantics")).booleanValue();
final TypeData typeData = new TypeData(length, decimal, array, arrayDimension, unsigned, zerofill, binary, args, charSemantics);
Word word = new Word(physicalName, logicalName, sqlType, typeData, description, database);
word = dictionary.getUniqueWord(word, true);
final NormalColumn column = new NormalColumn(word, notNull, false, unique, false, defaultValue, constraint, null, null, null);
columnGroup.addColumn(column);
}
columnGroups.add(columnGroup);
}
}
} catch (final IOException e) {
ERDiagramActivator.showExceptionDialog(e);
}
return columnGroups;
}