本文整理汇总了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;
}
示例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();
}
示例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();
}
});
}
示例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);
}
示例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);
}
示例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();
}
}
});
}
示例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();
}
});
}
示例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;
}
示例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();
}
});
}
示例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;
}
示例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;
}
示例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);
}
示例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();
}
示例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;
}
示例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;
}