当前位置: 首页>>代码示例>>Java>>正文


Java PreferenceDialog类代码示例

本文整理汇总了Java中org.eclipse.jface.preference.PreferenceDialog的典型用法代码示例。如果您正苦于以下问题:Java PreferenceDialog类的具体用法?Java PreferenceDialog怎么用?Java PreferenceDialog使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PreferenceDialog类属于org.eclipse.jface.preference包,在下文中一共展示了PreferenceDialog类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: execute

import org.eclipse.jface.preference.PreferenceDialog; //导入依赖的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: execute

import org.eclipse.jface.preference.PreferenceDialog; //导入依赖的package包/类
@Execute
	public void execute(@Named(IServiceConstants.ACTIVE_SHELL) Shell shell,  E4PreferenceRegistry prefReg, 
			@Optional @Named("preferencePageId") String pageId)
	{
		PreferenceManager pm = prefReg.getPreferenceManager();
		PreferenceDialog dialog = new PreferenceDialog(shell, pm);
		if (pageId != null)
		{
			dialog.setSelectedNode(pageId);
		}

		dialog.create();
		dialog.getTreeViewer().setComparator(new ViewerComparator());
//		dialog.getTreeViewer().expandAll();
		dialog.open();
		
	}
 
开发者ID:cplutte,项目名称:bts,代码行数:18,代码来源:E4PreferencesHandler.java

示例3: configureWorkspaceSettings

import org.eclipse.jface.preference.PreferenceDialog; //导入依赖的package包/类
private void configureWorkspaceSettings() {
	String preferenceNodeId = this.getPreferenceNodeId();
	IPreferencePage preferencePage = newPreferencePage();
	final IPreferenceNode preferenceNode = new PreferenceNode(preferenceNodeId, preferencePage);
	PreferenceManager manager = new PreferenceManager();
	manager.addToRoot(preferenceNode);
	final PreferenceDialog dialog = new PreferenceDialog(this.getControl().getShell(), manager);
	BusyIndicator.showWhile(this.getControl().getDisplay(), new Runnable() {
		@Override
		public void run() {
			dialog.create();
			dialog.setMessage(preferenceNode.getLabelText());
			dialog.open();
		}
	});
}
 
开发者ID:cincheo,项目名称:jsweet-eclipse-plugin,代码行数:17,代码来源:FieldEditorProjectPreferencePage.java

示例4: createControls

import org.eclipse.jface.preference.PreferenceDialog; //导入依赖的package包/类
protected void createControls() {
	group = new Group(this, SWT.NONE);
	group.setLayout(new GridLayout(3, false));
	imageLabel = new Label(group, SWT.NONE);
	GridDataFactory.fillDefaults().grab(false, false).align(SWT.BEGINNING, SWT.CENTER).applyTo(imageLabel);
	textLabel = new Link(group, SWT.WRAP);
	textLabel.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			if (DOWNLOAD_LINK.equals(e.text)) {
				Program.launch(DOWNLOAD_LINK);
			} else {
				PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(getShell(), PREF_PAGE_ID,
						new String[] { DISPLAY_ID }, null);
				dialog.setSelectedNode("DISPLAY_ID");
				dialog.open();
			}
		}
	});
	GridDataFactory.fillDefaults().grab(true, false).align(SWT.CENTER, SWT.CENTER).applyTo(textLabel);
	button = new Button(group, SWT.FLAT);
	button.setText("Download");
	GridDataFactory.fillDefaults().grab(false, false).align(SWT.END, SWT.CENTER).applyTo(button);
}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:25,代码来源:MessageArea.java

示例5: run

import org.eclipse.jface.preference.PreferenceDialog; //导入依赖的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

示例6: run

import org.eclipse.jface.preference.PreferenceDialog; //导入依赖的package包/类
@Override
public void run() {
	if (link == null) {
		return;
	}
	Display.getDefault().syncExec(new Runnable() {
		@Override
		public void run() {
			IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
			if (window != null) {
				 Shell shell = window.getShell();
                    shell.setMinimized(false);
                    shell.forceActive();
                    PreferenceDialog prefsDialog = PreferencesUtil.createPreferenceDialogOn(shell, link, null, additionalData);
                  	 prefsDialog.open();
			}
		}
	});
}
 
开发者ID:RichardBirenheide,项目名称:brainfuck,代码行数:20,代码来源:ActiveHelpOpenPreferencePageAction.java

示例7: showPreferencePage

import org.eclipse.jface.preference.PreferenceDialog; //导入依赖的package包/类
/**
 * Show a single preference pages
 * 
 * @param id
 *          - the preference page identification
 * @param page
 *          - the preference page
 */
protected void showPreferencePage(String id, IPreferencePage page, final IProject project) {
	final IPreferenceNode targetNode = new PreferenceNode(id, page);
	PreferenceManager manager = new PreferenceManager();
	manager.addToRoot(targetNode);
	Shell shell = getControl().getShell();
	final PreferenceDialog dialog = project == null ? new PreferenceDialog(shell, manager) : new PropertyDialog(shell,
			manager, new StructuredSelection(project));
	BusyIndicator.showWhile(getControl().getDisplay(), new Runnable() {
		public void run() {
			dialog.create();
			dialog.setMessage(targetNode.getLabelText());
			dialog.open();
		}
	});
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:24,代码来源:FieldEditorOverlayPage.java

示例8: execute

import org.eclipse.jface.preference.PreferenceDialog; //导入依赖的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

示例9: showPreferencePage

import org.eclipse.jface.preference.PreferenceDialog; //导入依赖的package包/类
/**
 * This method allows us to open the preference dialog on the specific page, in this case the perspective page
 * 
 * @param id
 *            the id of pref page to show
 * @param page
 *            the actual page to show Copied from org.eclipse.debug.internal.ui.SWTUtil
 */
public static void showPreferencePage(String id, IPreferencePage page)
{
	final IPreferenceNode targetNode = new PreferenceNode(id, page);
	PreferenceManager manager = new PreferenceManager();
	manager.addToRoot(targetNode);
	final PreferenceDialog dialog = new PreferenceDialog(UIUtils.getActiveShell(), manager);
	BusyIndicator.showWhile(getStandardDisplay(), new Runnable()
	{
		public void run()
		{
			dialog.create();
			dialog.setMessage(targetNode.getLabelText());
			dialog.open();
		}
	});
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:25,代码来源:SWTUtil.java

示例10: execute

import org.eclipse.jface.preference.PreferenceDialog; //导入依赖的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

示例11: execute

import org.eclipse.jface.preference.PreferenceDialog; //导入依赖的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

示例12: showPreferencePage

import org.eclipse.jface.preference.PreferenceDialog; //导入依赖的package包/类
protected boolean showPreferencePage()
{
    Trace.trace(Trace.CONFIG, "JettyRuntimeComposite: showPreferencePage()");

    String id = "org.eclipse.jdt.debug.ui.preferences.VMPreferencePage";

    // should be using the following API, but it only allows a single
    // preference page instance.
    // see bug 168211 for details
    // PreferenceDialog dialog =
    // PreferencesUtil.createPreferenceDialogOn(getShell(), id, new String[]
    // { id }, null);
    // return (dialog.open() == Window.OK);

    PreferenceManager manager = PlatformUI.getWorkbench().getPreferenceManager();
    IPreferenceNode node = manager.find("org.eclipse.jdt.ui.preferences.JavaBasePreferencePage").findSubNode(id);
    PreferenceManager manager2 = new PreferenceManager();
    manager2.addToRoot(node);
    PreferenceDialog dialog = new PreferenceDialog(getShell(),manager2);
    dialog.create();
    return (dialog.open() == Window.OK);
}
 
开发者ID:bengalaviz,项目名称:JettyWTPPlugin,代码行数:23,代码来源:JettyRuntimeComposite.java

示例13: checkPrefPageIdIsValid

import org.eclipse.jface.preference.PreferenceDialog; //导入依赖的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

示例14: execute

import org.eclipse.jface.preference.PreferenceDialog; //导入依赖的package包/类
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	Shell shell = HandlerUtil.getActiveShell(event);
	PreferenceDialog dialog = createPreferenceDialogOn(shell, ExternalLibraryPreferencePage.ID, FILTER_IDS, null);
	if (null != dialog) {
		dialog.open();
	}
	return null;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:10,代码来源:OpenExternalLibraryPreferencePageHandler.java

示例15: createDialogArea

import org.eclipse.jface.preference.PreferenceDialog; //导入依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {

	// create a composite with standard margins and spacing
	Composite composite = (Composite)super.createDialogArea(parent);
	composite.setLayout(new GridLayout(1, false));

	final CLabel warning = new CLabel(composite, SWT.LEFT);
	warning.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
	warning.setImage(Activator.imageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/error.png").createImage());
	warning.setText("Expert queue configuration parameters, please use with caution.");

	TableViewer viewer   = new TableViewer(composite, SWT.FULL_SELECTION | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);
	viewer.setUseHashlookup(true);
	viewer.getTable().setHeaderVisible(true);
	viewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

	createColumns(viewer);
	viewer.setContentProvider(createContentProvider());

	viewer.setInput(props);

	final Button adv = new Button(composite, SWT.PUSH);
	adv.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false));
	adv.setText("Advanced...");

	adv.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			PreferenceDialog pref = PreferencesUtil.createPreferenceDialogOn(getShell(), "org.dawnsci.commandserver.ui.activemqPage", null, null);
			if (pref != null) pref.open();
		}
	});

	return composite;
}
 
开发者ID:eclipse,项目名称:scanning,代码行数:37,代码来源:PropertiesDialog.java


注:本文中的org.eclipse.jface.preference.PreferenceDialog类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。