本文整理汇总了Java中org.eclipse.jface.dialogs.IDialogSettings类的典型用法代码示例。如果您正苦于以下问题:Java IDialogSettings类的具体用法?Java IDialogSettings怎么用?Java IDialogSettings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IDialogSettings类属于org.eclipse.jface.dialogs包,在下文中一共展示了IDialogSettings类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: restoreWidgetValues
import org.eclipse.jface.dialogs.IDialogSettings; //导入依赖的package包/类
/**
* Restores control settings that were saved in the previous instance of this page.
*/
private void restoreWidgetValues() {
IDialogSettings settings = getDialogSettings();
if (settings != null) {
String[] directoryNames = settings.getArray(getStoreDestinationNamesID());
if (directoryNames == null) {
return; // ie.- no settings stored
}
// destination
setDestinationValue(directoryNames[0]);
for (int i = 0; i < directoryNames.length; i++) {
addDestinationItem(directoryNames[i]);
}
// options
overwriteExistingFilesCheckbox.setSelection(settings.getBoolean(getStoreOverwriteExistingFilesID()));
}
}
示例2: saveWidgetValues
import org.eclipse.jface.dialogs.IDialogSettings; //导入依赖的package包/类
/**
* Hook method for saving widget values for restoration by the next instance of this class.
*/
private void saveWidgetValues() {
// update directory names history
IDialogSettings settings = getDialogSettings();
if (settings != null) {
String[] directoryNames = settings.getArray(getStoreDestinationNamesID());
if (directoryNames == null) {
directoryNames = new String[0];
}
directoryNames = addToHistory(directoryNames, getTargetDirectory());
settings.put(getStoreDestinationNamesID(), directoryNames);
// options
settings.put(getStoreOverwriteExistingFilesID(), overwriteExistingFilesCheckbox.getSelection());
}
}
示例3: internalSaveWidgetValues
import org.eclipse.jface.dialogs.IDialogSettings; //导入依赖的package包/类
@Override
protected void internalSaveWidgetValues() {
IDialogSettings settings = getDialogSettings();
if (settings != null) {
// update directory names history
String[] directoryNames = settings
.getArray(STORE_EXPORT_DESTINATION_FOLDERS_ID);
if (directoryNames == null) {
directoryNames = new String[0];
}
directoryNames = addToHistory(directoryNames, getDestinationValue());
settings.put(STORE_EXPORT_DESTINATION_FOLDERS_ID, directoryNames);
// store checkbox - compress
settings.put(STORE_EXPORT_COMPRESS_CONTENTS_ID, compressContentsCheckbox.getSelection());
}
}
示例4: restoreWidgetValues
import org.eclipse.jface.dialogs.IDialogSettings; //导入依赖的package包/类
@Override
protected void restoreWidgetValues() {
IDialogSettings settings = getDialogSettings();
if (settings != null) {
String[] directoryNames = settings
.getArray(STORE_EXPORT_DESTINATION_FOLDERS_ID);
if (directoryNames == null || directoryNames.length == 0) {
// ie.- no settings stored
} else {
// destination
setDestinationValue(directoryNames[0]);
for (int i = 0; i < directoryNames.length; i++) {
addDestinationItem(directoryNames[i]);
}
}
compressContentsCheckbox.setSelection(settings.getBoolean(STORE_EXPORT_COMPRESS_CONTENTS_ID));
}
}
示例5: internalSaveWidgetValues
import org.eclipse.jface.dialogs.IDialogSettings; //导入依赖的package包/类
/** save for next usage */
protected void internalSaveWidgetValues() {
IDialogSettings settings = getDialogSettings();
if (settings != null) {
// update goals history
String[] npmGoalLines = settings
.getArray(STORE_NPM_GOAL);
if (npmGoalLines == null) {
npmGoalLines = new String[0];
}
npmGoalLines = addToHistory(npmGoalLines, getGoalValue());
settings.put(STORE_NPM_GOAL, npmGoalLines);
// store checkbox - compress
settings.put(STORE_RUN_NPM_TOOL, runNpmCheckbox.getSelection());
}
}
示例6: restoreWidgetValues
import org.eclipse.jface.dialogs.IDialogSettings; //导入依赖的package包/类
@Override
protected void restoreWidgetValues() {
IDialogSettings settings = getDialogSettings();
if (settings != null) {
String[] npmGoalLines = settings
.getArray(STORE_NPM_GOAL);
if (npmGoalLines == null || npmGoalLines.length == 0) {
// ie.- no settings stored
} else {
// destination
setGoalValue(npmGoalLines[0]);
for (int i = 0; i < npmGoalLines.length; i++) {
addGoalItem(npmGoalLines[i]);
}
}
runNpmCheckbox.setSelection(settings.getBoolean(STORE_RUN_NPM_TOOL));
}
}
示例7: SimpleN4MFNewProjectWizard
import org.eclipse.jface.dialogs.IDialogSettings; //导入依赖的package包/类
/**
* Creates a new wizard container for creating and initializing a new N4JS project into the workspace.
*
* @param projectCreator
* the project creation logic to be triggered when finishing this wizard.
*/
@Inject
public SimpleN4MFNewProjectWizard(final IProjectCreator projectCreator) {
super(projectCreator);
setWindowTitle("New N4JS Project");
setNeedsProgressMonitor(true);
setDefaultPageImageDescriptor(NEW_PROJECT_WIZBAN_DESC);
projectInfo = new N4MFProjectInfo();
// Setup the dialog settings
IDialogSettings workbenchDialogSettings = N4MFActivator.getInstance().getDialogSettings();
IDialogSettings projectWizardSettings = workbenchDialogSettings.getSection(DIALOG_SETTINGS_SECTION_KEY);
if (null == projectWizardSettings) {
projectWizardSettings = workbenchDialogSettings.addNewSection(DIALOG_SETTINGS_SECTION_KEY);
}
setDialogSettings(projectWizardSettings);
}
示例8: getInitialSize
import org.eclipse.jface.dialogs.IDialogSettings; //导入依赖的package包/类
@Override
protected Point getInitialSize() {
IDialogSettings dialogSettings = getDialogSettings();
if (dialogSettings == null) {
/* no dialog settings available, so fall back to min settings */
return new Point(minWidth, minHeight);
}
Point point = super.getInitialSize();
if (point.x < minWidth) {
point.x = minWidth;
}
if (point.y < minHeight) {
point.y = minHeight;
}
return point;
}
示例9: initializeWidgetState
import org.eclipse.jface.dialogs.IDialogSettings; //导入依赖的package包/类
/**
* Initialize any state related to the widgetry that should be set up each
* time widgets are created.
*/
private void initializeWidgetState() {
menuManager = null;
dialogArea = null;
titleLabel = null;
titleSeparator = null;
infoSeparator = null;
infoLabel = null;
toolBar = null;
// If the menu item for persisting bounds is displayed, use the stored
// value to determine whether any persisted bounds should be honored at
// all.
if (showDialogMenu && showPersistActions) {
IDialogSettings settings = getDialogSettings();
if (settings != null) {
String key = getClass().getName() + DIALOG_USE_PERSISTED_SIZE;
if (settings.get(key) != null || !isUsing34API)
persistSize = settings.getBoolean(key);
key = getClass().getName() + DIALOG_USE_PERSISTED_LOCATION;
if (settings.get(key) != null || !isUsing34API)
persistLocation = settings.getBoolean(key);
}
}
}
示例10: migrateBoundsSetting
import org.eclipse.jface.dialogs.IDialogSettings; //导入依赖的package包/类
private void migrateBoundsSetting() {
IDialogSettings settings = getDialogSettings();
if (settings == null)
return;
final String className = getClass().getName();
String key = className + DIALOG_USE_PERSISTED_BOUNDS;
String value = settings.get(key);
if (value == null || DIALOG_VALUE_MIGRATED_TO_34.equals(value))
return;
boolean storeBounds = settings.getBoolean(key);
settings.put(className + DIALOG_USE_PERSISTED_LOCATION, storeBounds);
settings.put(className + DIALOG_USE_PERSISTED_SIZE, storeBounds);
settings.put(key, DIALOG_VALUE_MIGRATED_TO_34);
}
示例11: persistLocation
import org.eclipse.jface.dialogs.IDialogSettings; //导入依赖的package包/类
private void persistLocation() {
if (shell==null || shell.isDisposed()){
return;
}
IDialogSettings settings = getDialogSettings();
if (settings != null) {
Point shellLocation = shell.getLocation();
Shell parent = getParent();
if (parent != null) {
Point parentLocation = parent.getLocation();
shellLocation.x -= parentLocation.x;
shellLocation.y -= parentLocation.y;
}
String prefix = getClass().getName();
settings.put(prefix + DIALOG_ORIGIN_X, shellLocation.x);
settings.put(prefix + DIALOG_ORIGIN_Y, shellLocation.y);
}
}
示例12: getPersistedLocation
import org.eclipse.jface.dialogs.IDialogSettings; //导入依赖的package包/类
private Point getPersistedLocation() {
if (shell==null || shell.isDisposed()){
return null;
}
Point result = null;
IDialogSettings dialogSettings = getDialogSettings();
if (dialogSettings == null) {
return null;
}
try {
int x = dialogSettings.getInt(getClass().getName() + DIALOG_ORIGIN_X);
int y = dialogSettings.getInt(getClass().getName() + DIALOG_ORIGIN_Y);
result = new Point(x, y);
// The coordinates were stored relative to the parent shell.
// Convert to display coordinates.
Shell parentShell = getParent();
if (parentShell != null) {
Point parentLocation = parentShell.getLocation();
result.x += parentLocation.x;
result.y += parentLocation.y;
}
} catch (NumberFormatException e) {
}
return result;
}
示例13: LinkDialog
import org.eclipse.jface.dialogs.IDialogSettings; //导入依赖的package包/类
public LinkDialog(
final Shell parentShell,
final WorkItem workItem,
final LinkUIRegistry linkUiRegistry,
final WIFormLinksControlOptions linksControlOptions) {
super(parentShell);
this.workItem = workItem;
this.linkCollection = workItem.getLinks();
this.linkUiRegistry = linkUiRegistry;
this.linksControlOptions = linksControlOptions;
final IDialogSettings uiSettings = TFSCommonUIClientPlugin.getDefault().getDialogSettings();
final IDialogSettings dialogSettings = uiSettings.getSection(DIALOG_SETTINGS_SECTION_KEY);
if (dialogSettings != null) {
initialLinkTypeName = dialogSettings.get(DIALOG_SETTINGS_LINK_TYPE_KEY);
}
}
示例14: NewLinkedWorkItemDialog
import org.eclipse.jface.dialogs.IDialogSettings; //导入依赖的package包/类
public NewLinkedWorkItemDialog(
final Shell shell,
final WorkItem hostWorkItem,
final WIFormLinksControlOptions linksControlOptions) {
super(shell);
this.hostWorkItem = hostWorkItem;
client = hostWorkItem.getClient();
this.linksControlOptions = linksControlOptions;
witVersionSupportsWILinks = client.supportsWorkItemLinkTypes();
final IDialogSettings uiSettings = TFSCommonUIClientPlugin.getDefault().getDialogSettings();
final IDialogSettings dialogSettings = uiSettings.getSection(DIALOG_SETTINGS_SECTION_KEY);
if (dialogSettings != null) {
initialLinkTypeName = dialogSettings.get(DIALOG_SETTINGS_LINK_TYPE_KEY);
initialWorkItemTypeName = dialogSettings.get(DIALOG_SETTINGS_WORKITEM_TYPE_KEY);
}
}
示例15: okPressed
import org.eclipse.jface.dialogs.IDialogSettings; //导入依赖的package包/类
@Override
protected void okPressed() {
selectedTitle = textWorkItemTitle.getText();
selectedComment = textWorkItemComment.getText();
// Save the selected link-type in user setting so the next launch of the
// dialog will
// initially select the last used link-type.
final IDialogSettings uiSettings = TFSCommonUIClientPlugin.getDefault().getDialogSettings();
IDialogSettings dialogSettings = uiSettings.getSection(DIALOG_SETTINGS_SECTION_KEY);
if (dialogSettings == null) {
dialogSettings = uiSettings.addNewSection(DIALOG_SETTINGS_SECTION_KEY);
}
dialogSettings.put(DIALOG_SETTINGS_LINK_TYPE_KEY, linkTypeDisplayNames[selectedLinkTypeIndex]);
dialogSettings.put(DIALOG_SETTINGS_WORKITEM_TYPE_KEY, workItemTypeDisplayNames[selectedWorkItemTypeIndex]);
super.okPressed();
}