當前位置: 首頁>>代碼示例>>Java>>正文


Java IDialogSettings.getSections方法代碼示例

本文整理匯總了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[] {});
}
 
開發者ID:Microsoft,項目名稱:team-explorer-everywhere,代碼行數:12,代碼來源:DialogSettingsHelper.java

示例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;
}
 
開發者ID:roundrop,項目名稱:ermasterr,代碼行數:63,代碼來源:GlobalGroupSet.java


注:本文中的org.eclipse.jface.dialogs.IDialogSettings.getSections方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。