本文整理汇总了Java中org.eclipse.jface.dialogs.DialogSettings类的典型用法代码示例。如果您正苦于以下问题:Java DialogSettings类的具体用法?Java DialogSettings怎么用?Java DialogSettings使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DialogSettings类属于org.eclipse.jface.dialogs包,在下文中一共展示了DialogSettings类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ImportWizard
import org.eclipse.jface.dialogs.DialogSettings; //导入依赖的package包/类
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);
}
示例2: MasterSelectionDialog
import org.eclipse.jface.dialogs.DialogSettings; //导入依赖的package包/类
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 ();
}
示例3: setUp
import org.eclipse.jface.dialogs.DialogSettings; //导入依赖的package包/类
@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 );
}
示例4: save
import org.eclipse.jface.dialogs.DialogSettings; //导入依赖的package包/类
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);
}
}
示例5: doLoad
import org.eclipse.jface.dialogs.DialogSettings; //导入依赖的package包/类
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;
}
}
示例6: doStore
import org.eclipse.jface.dialogs.DialogSettings; //导入依赖的package包/类
@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);
}
}
示例7: buildSettings
import org.eclipse.jface.dialogs.DialogSettings; //导入依赖的package包/类
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;
}
示例8: writeCriteria
import org.eclipse.jface.dialogs.DialogSettings; //导入依赖的package包/类
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);
}
}
示例9: getDialogBoundsSettings
import org.eclipse.jface.dialogs.DialogSettings; //导入依赖的package包/类
@Override
protected IDialogSettings getDialogBoundsSettings ()
{
return DialogSettings.getOrCreateSection ( Activator.getDefault ().getDialogSettings (), "EventDetailsDialog" );
}
示例10: getDialogBoundsSettings
import org.eclipse.jface.dialogs.DialogSettings; //导入依赖的package包/类
@Override
protected IDialogSettings getDialogBoundsSettings ()
{
return DialogSettings.getOrCreateSection ( this.dialogSettings, "bounds" );
}
示例11: SetExternalNameWizard
import org.eclipse.jface.dialogs.DialogSettings; //导入依赖的package包/类
public SetExternalNameWizard ( final IStructuredSelection selection )
{
this.selection = selection;
setDialogSettings ( DialogSettings.getOrCreateSection ( Activator.getDefault ().getDialogSettings (), "setExternalNameWizard" ) );
}
示例12: getDialogBoundsSettings
import org.eclipse.jface.dialogs.DialogSettings; //导入依赖的package包/类
@Override
protected IDialogSettings getDialogBoundsSettings ()
{
return DialogSettings.getOrCreateSection ( Activator.getDefault ().getDialogSettings (), "componentOutputDialog" ); //$NON-NLS-1$
}
示例13: load
import org.eclipse.jface.dialogs.DialogSettings; //导入依赖的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;
}
示例14: save
import org.eclipse.jface.dialogs.DialogSettings; //导入依赖的package包/类
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);
}
}
示例15: save
import org.eclipse.jface.dialogs.DialogSettings; //导入依赖的package包/类
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);
}
}