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


Java IDialogSettings.put方法代碼示例

本文整理匯總了Java中org.eclipse.jface.dialogs.IDialogSettings.put方法的典型用法代碼示例。如果您正苦於以下問題:Java IDialogSettings.put方法的具體用法?Java IDialogSettings.put怎麽用?Java IDialogSettings.put使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.jface.dialogs.IDialogSettings的用法示例。


在下文中一共展示了IDialogSettings.put方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: 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());
	}
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:20,代碼來源:AbstractExportToSingleFileWizardPage.java

示例2: 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());
	}

}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:21,代碼來源:ExportSelectionPage.java

示例3: 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());
	}

}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:21,代碼來源:NpmToolRunnerPage.java

示例4: 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);
}
 
開發者ID:sergueik,項目名稱:SWET,代碼行數:18,代碼來源:PopupDialog.java

示例5: 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);
	}
}
 
開發者ID:de-jcup,項目名稱:egradle,代碼行數:19,代碼來源:SelectConfigurationDialog.java

示例6: performFinish

import org.eclipse.jface.dialogs.IDialogSettings; //導入方法依賴的package包/類
public boolean performFinish() {

        if (confirmUserData() == false) {
        	return false;
        }

        selectedResources = resourceSelectionTree.getSelectedResources();
        int[] hWeights = horizontalSash.getWeights();
		int[] vWeights = verticalSash.getWeights();
		IDialogSettings section = settings.getSection(COMMIT_WIZARD_DIALOG_SETTINGS);
    	if (section == null)
    		section= settings.addNewSection(COMMIT_WIZARD_DIALOG_SETTINGS);
		if (showCompare) {
			section.put(H_WEIGHT_1, hWeights[0]);
			section.put(H_WEIGHT_2, hWeights[1]);
		}
		section.put(V_WEIGHT_1, vWeights[0]);
		section.put(V_WEIGHT_2, vWeights[1]);
		section.put(SHOW_COMPARE, showCompare);
		return true;
	}
 
開發者ID:subclipse,項目名稱:subclipse,代碼行數:22,代碼來源:SvnWizardCommitPage.java

示例7: saveWidgetValues

import org.eclipse.jface.dialogs.IDialogSettings; //導入方法依賴的package包/類
/**
 * Saves the widget values for the next time
 */
private void saveWidgetValues() {
	// Update history
	IDialogSettings settings = getDialogSettings();
	if (settings != null) {
	    if (showCredentials) {
			String[] userNames = settings.getArray(STORE_USERNAME_ID);
			if (userNames == null) userNames = new String[0];
			userNames = addToHistory(userNames, userCombo.getText());
			settings.put(STORE_USERNAME_ID, userNames);
	    }
		String[] hostNames = settings.getArray(STORE_URL_ID);
		if (hostNames == null) hostNames = new String[0];
		hostNames = addToHistory(hostNames, urlCombo.getText());
		settings.put(STORE_URL_ID, hostNames);
	}
}
 
開發者ID:subclipse,項目名稱:subclipse,代碼行數:20,代碼來源:ConfigurationWizardMainPage.java

示例8: savePluginState

import org.eclipse.jface.dialogs.IDialogSettings; //導入方法依賴的package包/類
/**
 * Saves plugin state for next Eclipse session or when reopening the view.
 */
private void savePluginState() {
	if (!tabFolder.isDisposed()) {
		IDialogSettings section = Notepad4e.getDefault().getDialogSettings().getSection(ID);
		section.put(STORE_COUNT_KEY, tabFolder.getItemCount());
		for (int tabIndex = 0; tabIndex < tabFolder.getItemCount(); ++tabIndex) {
			CTabItem tab = tabFolder.getItem(tabIndex);
			if (!tab.isDisposed()) {
				Note note = getNote(tabIndex);
				section.put(STORE_TEXT_PREFIX_KEY + tabIndex, note.getText());
				section.put(STORE_STYLE_PREFIX_KEY + tabIndex, note.serialiseStyle());
				if (tab.getText().startsWith(LOCK_PREFIX)) {
					// Do not save lock symbol.
					section.put(STORE_TITLE_PREFIX_KEY + tabIndex, tab.getText().substring(LOCK_PREFIX.length()));
				} else {
					section.put(STORE_TITLE_PREFIX_KEY + tabIndex, tab.getText());
				}
				section.put(STORE_EDITABLE_PREFIX_KEY + tabIndex, note.getEditable());
				section.put(STORE_BULLETS_PREFIX_KEY + tabIndex, note.serialiseBullets());
			}
		}
		Notepad4e.save();
	}
}
 
開發者ID:PyvesB,項目名稱:Notepad4e,代碼行數:27,代碼來源:NotepadView.java

示例9: saveDialogBounds

import org.eclipse.jface.dialogs.IDialogSettings; //導入方法依賴的package包/類
/**
 * Saves the bounds of the shell in the appropriate dialog settings. The
 * bounds are recorded relative to the parent shell, if there is one, or
 * display coordinates if there is no parent shell. Subclasses typically
 * need not override this method, but may extend it (calling
 * <code>super.saveDialogBounds</code> if additional bounds information
 * should be stored. Clients may also call this method to persist the bounds
 * at times other than closing the dialog.
 * 
 * @param shell
 *            The shell whose bounds are to be stored
 */
protected void saveDialogBounds(Shell shell) {
	IDialogSettings settings = getDialogSettings();
	if (settings != null) {
		Point shellLocation = shell.getLocation();
		Point shellSize = shell.getSize();
		Shell parent = getParentShell();
		if (parent != null) {
			Point parentLocation = parent.getLocation();
			shellLocation.x -= parentLocation.x;
			shellLocation.y -= parentLocation.y;
		}
		String prefix = getClass().getName();
		if (persistSize) {
			settings.put(prefix + DIALOG_WIDTH, shellSize.x);
			settings.put(prefix + DIALOG_HEIGHT, shellSize.y);
		}
		if (persistLocation) {
			settings.put(prefix + DIALOG_ORIGIN_X, shellLocation.x);
			settings.put(prefix + DIALOG_ORIGIN_Y, shellLocation.y);
		}
		if (showPersistActions && showDialogMenu) {
			settings.put(getClass().getName() + DIALOG_USE_PERSISTED_SIZE,
					persistSize);
			settings.put(getClass().getName() + DIALOG_USE_PERSISTED_LOCATION,
					persistLocation);

		}
	}
}
 
開發者ID:sergueik,項目名稱:SWET,代碼行數:42,代碼來源:PopupDialog.java

示例10: storeDialog

import org.eclipse.jface.dialogs.IDialogSettings; //導入方法依賴的package包/類
protected void storeDialog(IDialogSettings settings) {
	settings.put(SHOW_CONSTANTS, toggleShowConstantsAction.isChecked());
	settings.put(SHOW_CLOSED_SPECS, toggleShowSpecAction.isChecked());
	settings.put(SASH_RATIO_TOP, sashForm.getWeights()[0]);
	settings.put(SASH_RATIO_BOTTOM, sashForm.getWeights()[1]);
	super.storeDialog(settings);
}
 
開發者ID:tlaplus,項目名稱:tlaplus,代碼行數:8,代碼來源:TLAFilteredItemsSelectionDialog.java

示例11: saveToSettings

import org.eclipse.jface.dialogs.IDialogSettings; //導入方法依賴的package包/類
public void saveToSettings(final IDialogSettings settings) {
    settings.put(SEARCH_TERMS_KEY, searchTerms);
    settings.put(SEARCH_TYPE_KEY, searchType);
    settings.put(INCLUDE_TITLE_KEY, includeTitle);
    settings.put(INCLUDE_DESCRIPTION_KEY, includeDescription);
    settings.put(INCLUDE_HISTORY_KEY, includeHistory);
    settings.put(INCLUDE_CUSTOM_FIELD1_KEY, includeCustomField1);
    settings.put(INCLUDE_CUSTOM_FIELD2_KEY, includeCustomField2);
    settings.put(INCLUDE_CUSTOM_FIELD3_KEY, includeCustomField3);
    settings.put(CUSTOM_FIELD1_KEY, customField1);
    settings.put(CUSTOM_FIELD2_KEY, customField2);
    settings.put(CUSTOM_FIELD3_KEY, customField3);
    settings.put(PROJECT_NAME_KEY, projectName);
    settings.put(WORK_ITEM_TYPE_NAME_KEY, workItemTypeName);
    settings.put(STATE_KEY, state);
    settings.put(ASSIGNED_TO_KEY, assignedTo);
    settings.put(AREA_PATH_KEY, areaPath);
    settings.put(ITERATION_PATH_KEY, iterationPath);
    settings.put(
        CREATED_DATE_ON_AFTER_KEY,
        (createdDateOnAfter != null ? String.valueOf(createdDateOnAfter.getTime()) : null));
    settings.put(
        CREATED_DATE_ON_BEFORE_KEY,
        (createdDateOnBefore != null ? String.valueOf(createdDateOnBefore.getTime()) : null));
    settings.put(
        CHANGED_DATE_ON_AFTER_KEY,
        (changedDateOnAfter != null ? String.valueOf(changedDateOnAfter.getTime()) : null));
    settings.put(
        CHANGED_DATE_ON_BEFORE_KEY,
        (changedDateOnBefore != null ? String.valueOf(changedDateOnBefore.getTime()) : null));
}
 
開發者ID:Microsoft,項目名稱:team-explorer-everywhere,代碼行數:32,代碼來源:WITSearchModel.java

示例12: persistShellGeometry

import org.eclipse.jface.dialogs.IDialogSettings; //導入方法依賴的package包/類
public static void persistShellGeometry(final Shell shell, final String dialogSettingsKey) {
    final Point shellLocation = shell.getLocation();
    final Point shellSize = shell.getSize();
    final IDialogSettings settings = getDialogSettings(dialogSettingsKey);
    settings.put(DIALOG_ORIGIN_X, shellLocation.x);
    settings.put(DIALOG_ORIGIN_Y, shellLocation.y);
    settings.put(DIALOG_WIDTH, shellSize.x);
    settings.put(DIALOG_HEIGHT, shellSize.y);
}
 
開發者ID:Microsoft,項目名稱:team-explorer-everywhere,代碼行數:10,代碼來源:DialogSettingsHelper.java

示例13: recordDialogOpened

import org.eclipse.jface.dialogs.IDialogSettings; //導入方法依賴的package包/類
public static void recordDialogOpened(final String dialogSettingsKey) {
    final IDialogSettings settings = getDialogSettings(dialogSettingsKey);
    int views = 0;
    try {
        views = settings.getInt(VIEWS);
    } catch (final NumberFormatException ex) {
        // ignore, leave views set to 0
    }
    settings.put(VIEWS, views + 1);
}
 
開發者ID:Microsoft,項目名稱:team-explorer-everywhere,代碼行數:11,代碼來源:DialogSettingsHelper.java

示例14: getDialogSettings

import org.eclipse.jface.dialogs.IDialogSettings; //導入方法依賴的package包/類
private static IDialogSettings getDialogSettings(final String dialogSettingsKey) {
    final IDialogSettings settings = TFSCommonUIClientPlugin.getDefault().getDialogSettings();
    IDialogSettings section = settings.getSection(dialogSettingsKey);
    if (section == null) {
        section = settings.addNewSection(dialogSettingsKey);
        final SimpleDateFormat formatter = new SimpleDateFormat(DATE_FORMAT);
        section.put(SINCE, formatter.format(new Date()));
    }

    return section;
}
 
開發者ID:Microsoft,項目名稱:team-explorer-everywhere,代碼行數:12,代碼來源:DialogSettingsHelper.java

示例15: renamePressed

import org.eclipse.jface.dialogs.IDialogSettings; //導入方法依賴的package包/類
private void renamePressed(){
	if (getSelected() == null) return;
	
	String result = this.getSelected();
	
	IDialogSettings settings = SootPlugin.getDefault().getDialogSettings();
	
	// gets current number of configurations
	int config_count = 0;
	int oldNameCount = 0;
	try {
		config_count = settings.getInt(Messages.getString("SootConfigManagerDialog.config_count")); //$NON-NLS-1$
	}
	catch (NumberFormatException e) {	
	}

	ArrayList currentNames = new ArrayList();
	for (int i = 1; i <= config_count; i++) {
		currentNames.add(settings.get(Messages.getString("SootConfigManagerDialog.soot_run_config")+i)); //$NON-NLS-1$
		if (((String)currentNames.get(i-1)).equals(result)){
			oldNameCount = i;
		}
	}

	
	// sets validator to know about already used names 
	SootConfigNameInputValidator validator = new SootConfigNameInputValidator();
	validator.setAlreadyUsed(currentNames);
	
	InputDialog nameDialog = new InputDialog(this.getShell(), Messages.getString("SootConfigManagerDialog.Rename_Saved_Configuration"), Messages.getString("SootConfigManagerDialog.Enter_new_name"), "", validator);  //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
	nameDialog.open();
	if (nameDialog.getReturnCode() == Dialog.OK){
		settings.put(Messages.getString("SootConfigManagerDialog.soot_run_config")+oldNameCount, nameDialog.getValue()); //$NON-NLS-1$
		settings.put(nameDialog.getValue(), settings.getArray(result));
		getTreeRoot().renameChild(result, nameDialog.getValue());
		saveMainClass(nameDialog.getValue(), settings.get(result+"_mainClass"));
	}
	refreshTree();
}
 
開發者ID:flankerhqd,項目名稱:JAADAS,代碼行數:40,代碼來源:SootConfigManagerDialog.java


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