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