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


Java PreferencesUtil.createPreferenceDialogOn方法代碼示例

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


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

示例1: execute

import org.eclipse.ui.dialogs.PreferencesUtil; //導入方法依賴的package包/類
public Object execute(ExecutionEvent event) throws ExecutionException
{
	UIJob job = new UIJob("Open Theme Preferences") //$NON-NLS-1$
	{

		@Override
		public IStatus runInUIThread(IProgressMonitor monitor)
		{
			final PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(UIUtils.getActiveShell(),
					ThemePreferencePage.ID, null, null);
			dialog.open();
			return Status.OK_STATUS;
		}
	};
	job.setPriority(Job.INTERACTIVE);
	job.setRule(PopupSchedulingRule.INSTANCE);
	job.schedule();
	return null;
}
 
開發者ID:apicloudcom,項目名稱:APICloud-Studio,代碼行數:20,代碼來源:OpenThemePreferencesHandler.java

示例2: run

import org.eclipse.ui.dialogs.PreferencesUtil; //導入方法依賴的package包/類
@Override
    public void run(IAction action) {
        List<String> typesToFilter = getTypesToFilter(selection2);

        String preferencePageId = "DataHierarchy.globalPrefPage";
        String types = DataHierarchyPlugin.getDefault().getPreferenceStore().getString(
                IPrefConstants.PREF_ACTIVE_FILTERS_LIST);
        PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(null, preferencePageId,
                null, typesToFilter);
        int open = dialog.open();
        if (open != Window.OK) {
            return;
        }
        String newTypes = DataHierarchyPlugin.getDefault().getPreferenceStore().getString(
                IPrefConstants.PREF_ACTIVE_FILTERS_LIST);
        if (types.equals(newTypes)) {
            return;
        }
        part.updateFilter(newTypes);
//        SearchAgainAction search = new SearchAgainAction();
//        search.init(part);
//        search.run(action);
    }
 
開發者ID:iloveeclipse,項目名稱:datahierarchy,代碼行數:24,代碼來源:AddToFilterAction.java

示例3: execute

import org.eclipse.ui.dialogs.PreferencesUtil; //導入方法依賴的package包/類
public final Object execute(final ExecutionEvent event)
{
	final String preferencePageId = event.getParameter(IWorkbenchCommandConstants.WINDOW_PREFERENCES_PARM_PAGEID);
	final IWorkbenchWindow activeWorkbenchWindow = HandlerUtil.getActiveWorkbenchWindow(event);

	final Shell shell;
	if (activeWorkbenchWindow == null)
	{
		shell = null;
	}
	else
	{
		shell = activeWorkbenchWindow.getShell();
	}

	final PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(shell, preferencePageId,
			new String[] { preferencePageId }, null);
	dialog.open();

	return null;
}
 
開發者ID:apicloudcom,項目名稱:APICloud-Studio,代碼行數:22,代碼來源:ShowFilteredPreferencePageHandler.java

示例4: execute

import org.eclipse.ui.dialogs.PreferencesUtil; //導入方法依賴的package包/類
@Override
public final Object execute(final ExecutionEvent event) {
	final IWorkbenchWindow activeWorkbenchWindow = HandlerUtil.getActiveWorkbenchWindow(event);

	final Shell shell;
	if (activeWorkbenchWindow == null) {
		shell = null;
	} else {
		shell = activeWorkbenchWindow.getShell();
	}

	final PreferenceDialog prefDialog = PreferencesUtil.createPreferenceDialogOn(shell, MergeEditorPreferencePage.PAGE_ID, null, null);
	if (prefDialog != null)
		prefDialog.open();

	return null;
}
 
開發者ID:nasa,項目名稱:OpenSPIFe,代碼行數:18,代碼來源:TableEditorPreferencePageHandler.java

示例5: execute

import org.eclipse.ui.dialogs.PreferencesUtil; //導入方法依賴的package包/類
@Override
public final Object execute(final ExecutionEvent event) {
	final IWorkbenchWindow activeWorkbenchWindow = HandlerUtil.getActiveWorkbenchWindow(event);

	final Shell shell;
	if (activeWorkbenchWindow == null) {
		shell = null;
	} else {
		shell = activeWorkbenchWindow.getShell();
	}

	final PreferenceDialog prefDialog = PreferencesUtil.createPreferenceDialogOn(shell, DaysEditorPreferencePage.PAGE_ID, null, null);
	if (prefDialog != null)
		prefDialog.open();

	return null;
}
 
開發者ID:nasa,項目名稱:OpenSPIFe,代碼行數:18,代碼來源:DaysEditorPreferencePageHandler.java

示例6: checkPrefPageIdIsValid

import org.eclipse.ui.dialogs.PreferencesUtil; //導入方法依賴的package包/類
protected void checkPrefPageIdIsValid(String prefId) {
	Shell shell = WorkbenchUtils.getActiveWorkbenchShell();
	PreferenceDialog prefDialog = PreferencesUtil.createPreferenceDialogOn(shell, prefId, null, null);
	assertNotNull(prefDialog); // Don't create, just eagerly check that it exits, that the ID is correct
	ISelection selection = prefDialog.getTreeViewer().getSelection();
	if(selection instanceof IStructuredSelection) {
		IStructuredSelection ss = (IStructuredSelection) selection;
		if(ss.getFirstElement() instanceof IPreferenceNode) {
			IPreferenceNode prefNode = (IPreferenceNode) ss.getFirstElement();
			if(prefNode.getId().equals(prefId)) {
				return; // Id exists
			}
		}
	}
	assertFail();
}
 
開發者ID:GoClipse,項目名稱:goclipse,代碼行數:17,代碼來源:GoUIPlugin.java

示例7: openPreferences

import org.eclipse.ui.dialogs.PreferencesUtil; //導入方法依賴的package包/類
/**
 * Opens the preferences dialog.
 */
private void openPreferences() {
  Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
  PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(
      shell, pageId, null, null);
  dialog.open();

  // not sure if I have to do any cleanup. If so, the we probably want to:
  // dialog.blockOnOpen(true), then do the cleanup
}
 
開發者ID:alfsch,項目名稱:workspacemechanic,代碼行數:13,代碼來源:OpenPreferencesAction.java

示例8: openAguiPrefs

import org.eclipse.ui.dialogs.PreferencesUtil; //導入方法依賴的package包/類
private void openAguiPrefs() {
    PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(
            getDisplay().getActiveShell(),
            AguiPreferencePage.PAGE_ID, //$NON-NLS-1$ preferencePageId
            null,  // displayedIds
            null); // data
    dialog.open();
}
 
開發者ID:thahn0720,項目名稱:agui_eclipse_plugin,代碼行數:9,代碼來源:AguiPlugin.java

示例9: openViewPreferencesDialog

import org.eclipse.ui.dialogs.PreferencesUtil; //導入方法依賴的package包/類
@Override
public void openViewPreferencesDialog() {
	PreferenceDialog dialog = 
			PreferencesUtil.createPreferenceDialogOn(
					null, 
					EditorConstants.PREF_PAGE_EDITOR_ID, 
					new String[]{
							EditorConstants.PREF_PAGE_EDITOR_ID, 
							BfTemplatePreferencePage.ID, 
							EditorConstants.PREF_PAGE_GENERAL_TEXT_EDITOR_ID}, 
					null);
	dialog.open();
}
 
開發者ID:RichardBirenheide,項目名稱:brainfuck,代碼行數:14,代碼來源:BfEditor.java

示例10: widgetSelected

import org.eclipse.ui.dialogs.PreferencesUtil; //導入方法依賴的package包/類
@Override
public void widgetSelected(SelectionEvent e) {
	String linkText = e.text;
	String additionalInfo = null;
	if (linkText.contains("#")) {
		String[] parts = linkText.split("#");
		linkText = parts[0];
		additionalInfo = parts[1];
	}
	PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(getShell(), linkText, null, additionalInfo);
	dialog.open();
}
 
開發者ID:RichardBirenheide,項目名稱:brainfuck,代碼行數:13,代碼來源:BfEditorPreferencePage.java

示例11: createPartControl

import org.eclipse.ui.dialogs.PreferencesUtil; //導入方法依賴的package包/類
@Override
public void createPartControl(final Composite parent) {
	PreferenceDialog dialog =
		PreferencesUtil.createPreferenceDialogOn(parent.getShell(), "msi.gama.lang.gaml.Gaml.templates",
			new String[] {}, null);
	PreferencePage selectedPage = (PreferencePage) dialog.getSelectedPage();
	selectedPage.createControl(parent);
}
 
開發者ID:gama-platform,項目名稱:gama,代碼行數:9,代碼來源:TemplatesView.java

示例12: execute

import org.eclipse.ui.dialogs.PreferencesUtil; //導入方法依賴的package包/類
/**
 * the command has been executed, so extract extract the needed information
 * from the application context.
 */
public Object execute(ExecutionEvent event) throws ExecutionException {
	IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
	PreferenceDialog pref = PreferencesUtil.createPreferenceDialogOn(window.getShell(), "org.ploys.ecle.prefs", null, null);
	if (pref != null)
		pref.open();		

	return null;
}
 
開發者ID:ploys,項目名稱:ecle,代碼行數:13,代碼來源:PrefsHandler.java

示例13: execute

import org.eclipse.ui.dialogs.PreferencesUtil; //導入方法依賴的package包/類
/**
 * Opens the perferences page 
 */
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	PreferenceDialog pd = PreferencesUtil.createPreferenceDialogOn(null,
							"hu.elte.txtuml.export.papyrus.preferences1", null, null);
	
	pd.open();
	return null;
}
 
開發者ID:ELTE-Soft,項目名稱:txtUML,代碼行數:12,代碼來源:PreferencesPageHandler.java

示例14: openFileInExternalProgram

import org.eclipse.ui.dialogs.PreferencesUtil; //導入方法依賴的package包/類
public static void openFileInExternalProgram(File file) throws IOException {
	LOG.info("opening file : " + file);
	String programPathString = FileCompletionActivator.getDefault().getPreferenceStore()
			.getString(FileCompletionActivator.openFileWithExternalProgramCmdPerfId);
	if (programPathString == null || programPathString.trim().length() == 0) {
		LOG.info("opening pref dialog");
		PreferenceDialog createPreferenceDialogOn = PreferencesUtil.createPreferenceDialogOn(null,
				FileCompletionActivator.fileCompletionPref, null, null);
		createPreferenceDialogOn.open();
		LOG.info("finishing pref dialog");
		// user should try again after setting external program
		return;
	}
	LOG.info("programPathString = " + programPathString);
	File programFile = new File(programPathString);
	if (!programFile.isFile()) {
		throw new FileNotFoundException(programPathString);
	}
	ArrayList<String> cmd = new ArrayList<String>();
	cmd.add(programPathString);
	String args = FileCompletionActivator.getDefault().getPreferenceStore()
			.getString(FileCompletionActivator.openFileWithExternalProgramArgsPerfId);
	if (args != null && args.length() > 0) {
		cmd.addAll(Arrays.asList(args.split(" ")));
	}
	cmd.add(file.getAbsolutePath());
	LOG.info("command to run : " + cmd);
	String[] command = cmd.toArray(new String[0]);
	Runtime.getRuntime().exec(command);
}
 
開發者ID:impetuouslab,項目名稱:eclipse-filecompletion,代碼行數:31,代碼來源:OpenFileInEclipseImpl.java

示例15: run

import org.eclipse.ui.dialogs.PreferencesUtil; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 */
@Override
public void run() {
	PreferenceDialog preferenceDialog= PreferencesUtil.createPreferenceDialogOn(getShell(), JAVA_TEMPLATE_PREFERENCE_PAGE_ID, new String[] { JAVA_TEMPLATE_PREFERENCE_PAGE_ID, CODE_TEMPLATE_PREFERENCE_PAGE_ID }, null);
	preferenceDialog.getTreeViewer().expandAll();
	preferenceDialog.open();
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:10,代碼來源:SurroundWithTemplateMenuAction.java


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