public ImportWizard() { setWindowTitle(App.messages.getString("app.window.title")); setNeedsProgressMonitor(true); setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(App.class, "images/i2b2Import2.png")); DialogSettings dialogSettings = new DialogSettings("userInfo"); try { // loads existing settings if any. dialogSettings.load(DIALOG_SETTING_FILE); } catch (IOException e) { System.out.println("INFO: Unable to locate user settings file. Default values will be used."); //e.printStackTrace(); } setDialogSettings(dialogSettings); }
public MasterSelectionDialog ( final Shell parentShell, final World world ) { super ( parentShell ); this.world = world; setHelpAvailable ( false ); this.dialogSettings = DialogSettings.getOrCreateSection ( Activator.getDefault ().getDialogSettings (), "MasterSelectionDialog" ); this.lastSelection = loadLastSelection (); }
@Before public void setUp() { launchManager = mock( ILaunchManager.class ); when( launchManager.getLaunchModes() ).thenReturn( new ILaunchMode[ 0 ] ); DialogSettings dialogSettings = new DialogSettings( "section-name" ); launchModeSetting = new LaunchModeSetting( launchManager, dialogSettings ); }
public static void save(ColumnGroupSet columnGroups) { try { final IDialogSettings settings = new DialogSettings("column_group_list"); settings.put("database", columnGroups.getDatabase()); int index = 0; for (final ColumnGroup columnGroup : columnGroups) { final IDialogSettings columnGroupSection = new DialogSettings("column_group_" + index); index++; columnGroupSection.put("group_name", columnGroup.getGroupName()); int columnIndex = 0; for (final NormalColumn normalColumn : columnGroup.getColumns()) { final IDialogSettings columnSection = new DialogSettings("column_" + columnIndex); columnIndex++; columnSection.put("physical_name", null2Blank(normalColumn.getPhysicalName())); columnSection.put("logical_name", null2Blank(normalColumn.getLogicalName())); columnSection.put("type", null2Blank(normalColumn.getType())); columnSection.put("length", null2Blank(normalColumn.getTypeData().getLength())); columnSection.put("decimal", null2Blank(normalColumn.getTypeData().getDecimal())); columnSection.put("array", normalColumn.getTypeData().isArray()); columnSection.put("array_dimension", null2Blank(normalColumn.getTypeData().getArrayDimension())); columnSection.put("unsigned", normalColumn.getTypeData().isUnsigned()); columnSection.put("not_null", normalColumn.isNotNull()); columnSection.put("unique", normalColumn.isUniqueKey()); columnSection.put("default_value", null2Blank(normalColumn.getDefaultValue())); columnSection.put("constraint", null2Blank(normalColumn.getConstraint())); columnSection.put("description", null2Blank(normalColumn.getDescription())); columnGroupSection.addSection(columnSection); } settings.addSection(columnGroupSection); } settings.save(getPath()); } catch (final IOException e) { Activator.showExceptionDialog(e); } }
protected void doLoad(String s) { StringReader r = new StringReader(s); IDialogSettings settings = new DialogSettings(getPreferenceName()); try { settings.load(r); } catch (IOException e) { trace.error(e.getMessage(), e); } combo.removeAll(); int index = -1; String selection = settings.get(P_SELECTED_SET); String list[] = settings.getArray(P_SET_KEYS); for (int i=0; list != null && i<list.length; i++) { String key = list[i]; IDialogSettings section = settings.getSection(key); if (section != null) { PickListSet set = new PickListSet(section); setsByName.put(key, set); combo.add(key); if (CommonUtils.equals(selection, key)) { index = i; } } } combo.add(ITEM_NEW); if (index != -1) { combo.select(index); lastSelection = index; } }
@Override protected void doStore() { try { int index = combo.getSelectionIndex(); IDialogSettings settings = new DialogSettings(getPreferenceName()); settings.put(P_SET_KEYS, combo.getItems()); settings.put(P_SELECTED_SET, combo.getItem(index)); for(int i=0; i<combo.getItemCount(); i++) { String key = combo.getItem(i); if (key.equals(ITEM_NEW)) { continue; } PickListSet set = setsByName.get(key); if (i == index) { set = new PickListSet(key, Arrays.asList(pickListEditor.getSelectedListControl().getItems())); setsByName.put(key, set); } settings.addSection(set.getSettings()); } StringWriter w = new StringWriter(); settings.save(w); getPreferenceStore().putValue(getPreferenceName(), w.toString()); } catch(Exception e) { trace.error(e.getMessage(), e); } }
public static IDialogSettings buildSettings(String settingsName, List<PickListSet> list) { IDialogSettings settings = new DialogSettings(settingsName); List<String> keys = new ArrayList<String>(); for (PickListSet set : list) { settings.addSection(set.getSettings()); keys.add(set.getName()); } settings.put(P_SET_KEYS, keys.toArray(new String[0])); return settings; }
private void writeCriteria() { final IDialogSettings s = DialogSettings.getOrCreateSection(Activator.getPlugin().getDialogSettings(), PAGE_NAME); final int historySize = Math.min(history.size(), HISTORY_SIZE); final IDialogSettings allCriteria = DialogSettings.getOrCreateSection(s, STORE_SEARCH_CRITERIA); for (int i = 0; i < historySize; i++) { final IDialogSettings searchCriteria = allCriteria.addNewSection(STORE_SEARCH_CRITERIA + "[" + i + "]"); final Criteria criteria = history.get(i); searchCriteria.put(STORE_SEARCH_TERM, criteria.searchTerm); searchCriteria.put(STORE_MATCH_TYPES, criteria.matchType); } }
@Override protected IDialogSettings getDialogBoundsSettings () { return DialogSettings.getOrCreateSection ( Activator.getDefault ().getDialogSettings (), "EventDetailsDialog" ); }
@Override protected IDialogSettings getDialogBoundsSettings () { return DialogSettings.getOrCreateSection ( this.dialogSettings, "bounds" ); }
public SetExternalNameWizard ( final IStructuredSelection selection ) { this.selection = selection; setDialogSettings ( DialogSettings.getOrCreateSection ( Activator.getDefault ().getDialogSettings (), "setExternalNameWizard" ) ); }
@Override protected IDialogSettings getDialogBoundsSettings () { return DialogSettings.getOrCreateSection ( Activator.getDefault ().getDialogSettings (), "componentOutputDialog" ); //$NON-NLS-1$ }
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; }
public static void save(final GroupSet columnGroups) { try { final IDialogSettings settings = new DialogSettings("column_group_list"); settings.put("database", columnGroups.getDatabase()); int index = 0; for (final ColumnGroup columnGroup : columnGroups) { final IDialogSettings columnGroupSection = new DialogSettings("column_group_" + index); index++; columnGroupSection.put("group_name", columnGroup.getGroupName()); int columnIndex = 0; for (final NormalColumn normalColumn : columnGroup.getColumns()) { final IDialogSettings columnSection = new DialogSettings("column_" + columnIndex); columnIndex++; columnSection.put("physical_name", null2Blank(normalColumn.getPhysicalName())); columnSection.put("logical_name", null2Blank(normalColumn.getLogicalName())); columnSection.put("type", null2Blank(normalColumn.getType())); columnSection.put("length", null2Blank(normalColumn.getTypeData().getLength())); columnSection.put("decimal", null2Blank(normalColumn.getTypeData().getDecimal())); columnSection.put("array", normalColumn.getTypeData().isArray()); columnSection.put("array_dimension", null2Blank(normalColumn.getTypeData().getArrayDimension())); columnSection.put("unsigned", normalColumn.getTypeData().isUnsigned()); columnSection.put("zerofill", normalColumn.getTypeData().isZerofill()); columnSection.put("binary", normalColumn.getTypeData().isBinary()); columnSection.put("not_null", normalColumn.isNotNull()); columnSection.put("unique", normalColumn.isUniqueKey()); columnSection.put("default_value", null2Blank(normalColumn.getDefaultValue())); columnSection.put("constraint", null2Blank(normalColumn.getConstraint())); columnSection.put("description", null2Blank(normalColumn.getDescription())); columnSection.put("char_semantics", normalColumn.getTypeData().isCharSemantics()); columnGroupSection.addSection(columnSection); } settings.addSection(columnGroupSection); } settings.save(getPath()); } catch (final IOException e) { ERDiagramActivator.showExceptionDialog(e); } }
public static void save(GroupSet columnGroups) { try { IDialogSettings settings = new DialogSettings("column_group_list"); settings.put("database", columnGroups.getDatabase()); int index = 0; for (ColumnGroup columnGroup : columnGroups) { IDialogSettings columnGroupSection = new DialogSettings( "column_group_" + index); index++; columnGroupSection .put("group_name", columnGroup.getGroupName()); int columnIndex = 0; for (NormalColumn normalColumn : columnGroup.getColumns()) { IDialogSettings columnSection = new DialogSettings( "column_" + columnIndex); columnIndex++; columnSection.put("physical_name", null2Blank(normalColumn.getPhysicalName())); columnSection.put("logical_name", null2Blank(normalColumn.getLogicalName())); columnSection.put("type", null2Blank(normalColumn.getType())); columnSection.put("length", null2Blank(normalColumn .getTypeData().getLength())); columnSection.put("decimal", null2Blank(normalColumn .getTypeData().getDecimal())); columnSection.put("array", normalColumn.getTypeData() .isArray()); columnSection.put("array_dimension", null2Blank(normalColumn.getTypeData() .getArrayDimension())); columnSection.put("unsigned", normalColumn.getTypeData() .isUnsigned()); columnSection.put("zerofill", normalColumn.getTypeData() .isZerofill()); columnSection.put("binary", normalColumn.getTypeData() .isBinary()); columnSection.put("not_null", normalColumn.isNotNull()); columnSection.put("unique", normalColumn.isUniqueKey()); columnSection.put("default_value", null2Blank(normalColumn.getDefaultValue())); columnSection.put("constraint", null2Blank(normalColumn.getConstraint())); columnSection.put("description", null2Blank(normalColumn.getDescription())); columnSection.put("char_semantics", normalColumn .getTypeData().isCharSemantics()); columnGroupSection.addSection(columnSection); } settings.addSection(columnGroupSection); } settings.save(getPath()); } catch (IOException e) { ERDiagramActivator.showExceptionDialog(e); } }
@Override protected IDialogSettings getDialogSettings() { IDialogSettings dialogSettings = LaunchExtrasPlugin.getInstance().getDialogSettings(); return DialogSettings.getOrCreateSection( dialogSettings, "LaunchSelectionDialog" ); }
@Before public void setUp() { launchManager = mock( ILaunchManager.class ); dialogSettings = new DialogSettings( "section-name" ); launchModeSetting = new LaunchModeSetting( launchManager, dialogSettings ); }
public TestableLaunchSelectionDialog( Shell shell ) { super( shell ); dialogSettings = new DialogSettings( "TestableLaunchSelectionDialog" ); }
@Override protected IDialogSettings getDialogSettings() { final IDialogSettings result = new DialogSettings("NodeSelectionDialog"); //$NON-NLS-1$ return result; }
public static ColumnGroupSet load() { final ColumnGroupSet columnGroups = new ColumnGroupSet(); 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); 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 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, args, charSemantics); final Word word = new Word(physicalName, logicalName, sqlType, typeData, description, database); 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) { Activator.showExceptionDialog(e); } return columnGroups; }
public PlanExportWizardImpl() { setDialogSettings(new DialogSettings(ID)); loadSettings(); }
@Override protected IDialogSettings getDialogSettings() { final IDialogSettings master = super.getDialogSettings(); return DialogSettings.getOrCreateSection(master, this.contextTypeId); }
@Override protected IDialogSettings getDialogSettings(){ return new DialogSettings("diagnoseselektor"); //$NON-NLS-1$ }
@Override protected IDialogSettings getDialogSettings(){ return new DialogSettings("loincselector"); //$NON-NLS-1$ }