org.eclipse.ui.dialogs.PreferencesUtil Java Examples

The following examples show how to use org.eclipse.ui.dialogs.PreferencesUtil. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CleanUpSaveParticipantPreferenceConfiguration.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
private void configurePreferenceLink(Link link, final IJavaProject javaProject, final String preferenceId, final String propertyId) {
	link.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			if (fContainer instanceof IWorkbenchPreferenceContainer) {
				IWorkbenchPreferenceContainer container= (IWorkbenchPreferenceContainer)fContainer;
				if (javaProject != null) {
					container.openPage(propertyId, null);
				} else {
					container.openPage(preferenceId, null);
				}
			} else {
				PreferencesUtil.createPreferenceDialogOn(fShell, preferenceId, null, null);
			}
		}
	});
}
 
Example #2
Source File: LoadDialog.java    From tracecompass with Eclipse Public License 2.0 6 votes vote down vote up
@Override
protected void createButtonsForButtonBar(final Composite parent) {
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
    Button manageButton = createButton(parent, IDialogConstants.CLIENT_ID + 1, Messages.TraceControl_ManageButtonText, false);
    manageButton.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            PreferenceDialog dialog =
                    PreferencesUtil.createPreferenceDialogOn(parent.getShell(),
                            ControlRemoteProfilesPreferencePage.ID,
                            new String[] { ControlRemoteProfilesPreferencePage.ID },
                            null);
            dialog.open();
            if (fLocalComposite != null) {
                fFolderViewer.setInput(LTTngProfileViewer.getViewerInput());
                enableLocalButtons();
            }
        }
    });
    Button button = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, false);
    button.setEnabled(false);
}
 
Example #3
Source File: JavaSearchResultPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void init(IPageSite site) {
	super.init(site);
	IMenuManager menuManager = site.getActionBars().getMenuManager();
	menuManager.insertBefore(IContextMenuConstants.GROUP_PROPERTIES, new Separator(GROUP_FILTERING));
	fActionGroup.fillActionBars(site.getActionBars());
	menuManager.appendToGroup(IContextMenuConstants.GROUP_PROPERTIES, new Action(SearchMessages.JavaSearchResultPage_preferences_label) {
		@Override
		public void run() {
			String pageId= "org.eclipse.search.preferences.SearchPreferencePage"; //$NON-NLS-1$
			String[] displayedPages= { pageId,
					"org.eclipse.ui.editors.preferencePages.Annotations", //$NON-NLS-1$
					"org.eclipse.ui.preferencePages.ColorsAndFonts" //$NON-NLS-1$
			};
			PreferencesUtil.createPreferenceDialogOn(JavaPlugin.getActiveWorkbenchShell(), pageId, displayedPages, null).open();
		}
	});
}
 
Example #4
Source File: PropertiesFileEditorPreferencePage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
private void createHeader(Composite contents) {
	String text= PreferencesMessages.PropertiesFileEditorPreferencePage_link;
	Link link= new Link(contents, SWT.NONE);
	link.setText(text);
	link.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			if ("org.eclipse.ui.preferencePages.GeneralTextEditor".equals(e.text)) //$NON-NLS-1$
				PreferencesUtil.createPreferenceDialogOn(getShell(), e.text, null, null);
			else if ("org.eclipse.ui.preferencePages.ColorsAndFonts".equals(e.text)) //$NON-NLS-1$
				PreferencesUtil.createPreferenceDialogOn(getShell(), e.text, null, "selectFont:org.eclipse.jdt.ui.PropertiesFileEditor.textfont"); //$NON-NLS-1$
		}
	});

	GridData gridData= new GridData(SWT.FILL, SWT.BEGINNING, true, false);
	gridData.widthHint= 150; // only expand further if anyone else requires it
	link.setLayoutData(gridData);

	addFiller(contents);
}
 
Example #5
Source File: JavaEditorAppearanceConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
private void createHeader(Composite contents) {
	final Shell shell= contents.getShell();
	String text= PreferencesMessages.JavaEditorPreferencePage_link;
	Link link= new Link(contents, SWT.NONE);
	link.setText(text);
	link.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			if ("org.eclipse.ui.preferencePages.GeneralTextEditor".equals(e.text)) //$NON-NLS-1$
				PreferencesUtil.createPreferenceDialogOn(shell, e.text, null, null);
			else if ("org.eclipse.ui.preferencePages.ColorsAndFonts".equals(e.text)) //$NON-NLS-1$
				PreferencesUtil.createPreferenceDialogOn(shell, e.text, null, "selectFont:org.eclipse.jdt.ui.editors.textfont"); //$NON-NLS-1$
		}
	});

	GridData gridData= new GridData(SWT.FILL, SWT.BEGINNING, true, false);
	gridData.widthHint= 150; // only expand further if anyone else requires it
	link.setLayoutData(gridData);

	addFiller(contents);
}
 
Example #6
Source File: CodeAssistAdvancedConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
private void createKeysLink(Composite composite, int h_span) {
   Link link= new Link(composite, SWT.NONE | SWT.WRAP);
link.setText(PreferencesMessages.CodeAssistAdvancedConfigurationBlock_key_binding_hint);
link.addSelectionListener(new SelectionAdapter() {
	@Override
	public void widgetSelected(SelectionEvent e) {
		PreferencesUtil.createPreferenceDialogOn(getShell(), e.text, null, null);
	}
});

PixelConverter pixelConverter= new PixelConverter(composite);
int width= pixelConverter.convertWidthInCharsToPixels(40);

// limit the size of the Link as it would take all it can get
GridData gd= new GridData(GridData.FILL, GridData.FILL, false, false, h_span, 1);
gd.widthHint= width;
link.setLayoutData(gd);
  }
 
Example #7
Source File: MainProjectWizardPage.java    From sarl with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("synthetic-access")
@Override
public void widgetDefaultSelected(SelectionEvent event) {
	final String jreID = BuildPathSupport.JRE_PREF_PAGE_ID;
	final String eeID = BuildPathSupport.EE_PREF_PAGE_ID;
	final String complianceId = CompliancePreferencePage.PREF_ID;
	final Map<String, Boolean> data = new HashMap<>();
	data.put(PropertyAndPreferencePage.DATA_NO_LINK, Boolean.TRUE);
	PreferencesUtil.createPreferenceDialogOn(
			getShell(), jreID,
			new String[] {jreID, complianceId, eeID},
			data).open();

	handlePossibleJVMChange();
	MainProjectWizardPage.this.detectGroup.handlePossibleJVMChange();
}
 
Example #8
Source File: AddRepositoryDialog.java    From olca-app with Mozilla Public License 2.0 6 votes vote down vote up
private void createConfigViewer(Composite container, FormToolkit toolkit) {
	UI.formLabel(container, toolkit, M.ServerUrl);
	configViewer = new ConfigViewer(container);
	configViewer.setInput(CloudConfigurations.get());
	Hyperlink editConfig = UI.formLink(container, toolkit, M.Edit);
	editConfig.setForeground(Colors.linkBlue());
	editConfig.addHyperlinkListener(new HyperlinkAdapter() {
		@Override
		public void linkActivated(HyperlinkEvent e) {
			PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(null, CloudPreferencePage.ID,
					null, null);
			dialog.setBlockOnOpen(true);
			dialog.open();
			configViewer.setInput(CloudConfigurations.get());
			configViewer.select(CloudConfigurations.getDefault());
		}
	});
}
 
Example #9
Source File: MainProjectWizardPage.java    From sarl with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("synthetic-access")
@Override
public void widgetDefaultSelected(SelectionEvent event) {
	final String jreID = BuildPathSupport.JRE_PREF_PAGE_ID;
	final String eeID = BuildPathSupport.EE_PREF_PAGE_ID;
	final String complianceId = CompliancePreferencePage.PREF_ID;
	final Map<String, Boolean> data = new HashMap<>();
	data.put(PropertyAndPreferencePage.DATA_NO_LINK, Boolean.TRUE);
	final String id = "JRE".equals(event.text) ? jreID : complianceId; //$NON-NLS-1$
	PreferencesUtil.createPreferenceDialogOn(getShell(), id,
			new String[] {jreID, complianceId, eeID},
			data).open();

	MainProjectWizardPage.this.jreGroup.handlePossibleJVMChange();
	handlePossibleJVMChange();
}
 
Example #10
Source File: RLSStreamConnectionProvider.java    From corrosion with Eclipse Public License 2.0 6 votes vote down vote up
private static void showSetupRustNotification() {
	Display.getDefault().asyncExec(() -> {
		if (hasCancelledSetup) {
			return;
		}
		setHasCancelledSetup(true);
		Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
		int dialogResponse = MessageDialog.open(MessageDialog.CONFIRM, shell,
				Messages.RLSStreamConnectionProvider_rustSupportNotFound,
				Messages.RLSStreamConnectionProvider_requirementsNotFound, SWT.NONE,
				Messages.RLSStreamConnectionProvider_OpenPreferences, IDialogConstants.CANCEL_LABEL); // $NON-NLS-4$
		if (dialogResponse == 0) {
			PreferenceDialog preferenceDialog = PreferencesUtil.createPreferenceDialogOn(shell,
					CorrosionPreferencePage.PAGE_ID, new String[] { CorrosionPreferencePage.PAGE_ID }, null);
			preferenceDialog.setBlockOnOpen(true);
			preferenceDialog.open();
			setHasCancelledSetup(false);
		}
	});
}
 
Example #11
Source File: GoUIPlugin.java    From goclipse with Eclipse Public License 1.0 6 votes vote down vote up
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();
}
 
Example #12
Source File: ShowFilteredPreferencePageHandler.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
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;
}
 
Example #13
Source File: NewJavaProjectWizardPageOne.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public void widgetDefaultSelected(SelectionEvent e) {
	String jreID= BuildPathSupport.JRE_PREF_PAGE_ID;
	String eeID= BuildPathSupport.EE_PREF_PAGE_ID;
	String complianceId= CompliancePreferencePage.PREF_ID;
	Map<String, Boolean> data= new HashMap<String, Boolean>();
	data.put(PropertyAndPreferencePage.DATA_NO_LINK, Boolean.TRUE);
	String id= "JRE".equals(e.text) ? jreID : complianceId; //$NON-NLS-1$
	PreferencesUtil.createPreferenceDialogOn(getShell(), id, new String[] { jreID, complianceId, eeID  }, data).open();

	fJREGroup.handlePossibleJVMChange();
	handlePossibleJVMChange();
}
 
Example #14
Source File: SDKStatusHandler.java    From thym with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void handle(IStatus status) {
	boolean define = MessageDialog
			.openQuestion(AbstractStatusHandler.getShell(),
					Messages.SDKStatusHandler_Title,
					Messages.SDKStatusHandler_Message);
	if (define) {
		PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(
				getShell(), WPPreferencePage.PAGE_ID, null, null);
		dialog.open();
	}
}
 
Example #15
Source File: CodeAssistConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
protected final void openStaticImportFavoritesPage() {
	if (getPreferenceContainer() != null) {
		getPreferenceContainer().openPage(CodeAssistFavoritesPreferencePage.PAGE_ID, null);
	} else {
		PreferencesUtil.createPreferenceDialogOn(getShell(), CodeAssistFavoritesPreferencePage.PAGE_ID, null, null).open();
	}
}
 
Example #16
Source File: UserLibraryMarkerResolutionGenerator.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
protected void createUserLibrary(final Shell shell, IPath unboundPath) {
	String name= unboundPath.segment(1);
	String id= UserLibraryPreferencePage.ID;
	HashMap<String, Object> data= new HashMap<String, Object>(3);
	data.put(UserLibraryPreferencePage.DATA_LIBRARY_TO_SELECT, name);
	data.put(UserLibraryPreferencePage.DATA_DO_CREATE, Boolean.TRUE);
	PreferencesUtil.createPreferenceDialogOn(shell, id, new String[] { id }, data).open();
}
 
Example #17
Source File: ComplianceConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
protected final void openJREInstallPreferencePage(boolean openEE) {
	String jreID= BuildPathSupport.JRE_PREF_PAGE_ID;
	String eeID= BuildPathSupport.EE_PREF_PAGE_ID;
	String pageId= openEE ? eeID : jreID;
	if (fProject == null && getPreferenceContainer() != null) {
		getPreferenceContainer().openPage(pageId, null);
	} else {
		PreferencesUtil.createPreferenceDialogOn(getShell(), pageId, new String[] { jreID, eeID }, null).open();
	}
	validateComplianceStatus();
}
 
Example #18
Source File: CodeAssistConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
private void createPreferencePageLink(Composite composite, String label, final Map<String, String> targetInfo) {
	final Link link= new Link(composite, SWT.NONE);
	link.setText(label);
	link.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			PreferencesUtil.createPreferenceDialogOn(link.getShell(), e.text, null, targetInfo);
		}
	});
}
 
Example #19
Source File: BluemixUtil.java    From XPagesExtensionLibrary with Apache License 2.0 5 votes vote down vote up
public static void displayConfigureServerDialog() {
    String msg = BluemixUtil.productizeString("The %BM_PRODUCT% Server connection is not configured correctly. Open the %BM_PRODUCT% preferences?"); // $NLX-BluemixUtil.TheIBMBluemixServerconnectionisnotco-1$
    if(MessageDialog.openQuestion(null, "Server Configuration", msg)) { // $NLX-BluemixUtil.ServerConfiguration-1$ 
        PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(null, PreferencePage.BLUEMIX_PREF_PAGE, null, null);
        dialog.open();
    }
}
 
Example #20
Source File: ControlUtils.java    From goclipse with Eclipse Public License 1.0 5 votes vote down vote up
public static Link createOpenPreferencesDialogLinkedText(final Composite topControl, String linkText,
		Consumer<Link> afterDialogOpen) {
	Link link = new Link(topControl, SWT.NONE);
	link.setText(linkText);
	link.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			PreferencesUtil.createPreferenceDialogOn(topControl.getShell(),e.text, null, null).open();
			if(afterDialogOpen != null) {
				afterDialogOpen.accept(link);
			}
		}
	});
	return link;
}
 
Example #21
Source File: ConfigureInterpreterJob.java    From Pydev with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public IStatus runInUIThread(IProgressMonitor monitor) {
    Set<AbstractInterpreterManager> current = interpreters;
    interpreters = new HashSet<AbstractInterpreterManager>();
    for (AbstractInterpreterManager m : current) {
        try {
            m.getDefaultInterpreterInfo(false);
            continue; //Maybe it got configured at some other point...
        } catch (NotConfiguredInterpreterException e) {
            int ret = PyDialogHelpers.openQuestionConfigureInterpreter(m);
            if (ret != PyDialogHelpers.INTERPRETER_CANCEL_CONFIG) {
                if (ret == InterpreterConfigHelpers.CONFIG_MANUAL) {

                    PreferencesUtil.createPreferenceDialogOn(null, m.getPreferencesPageId(), null, null).open();
                } else if (ret == InterpreterConfigHelpers.CONFIG_ADV_AUTO
                        || ret == InterpreterConfigHelpers.CONFIG_AUTO) {
                    InterpreterType interpreterType;
                    switch (m.getInterpreterType()) {
                        case IPythonNature.INTERPRETER_TYPE_JYTHON:
                            interpreterType = InterpreterType.JYTHON;
                            break;

                        case IPythonNature.INTERPRETER_TYPE_IRONPYTHON:
                            interpreterType = InterpreterType.IRONPYTHON;
                            break;

                        default:
                            interpreterType = InterpreterType.PYTHON;
                    }
                    boolean advanced = ret == InterpreterConfigHelpers.CONFIG_ADV_AUTO;
                    AutoConfigMaker a = new AutoConfigMaker(interpreterType, advanced, null, null);
                    a.autoConfigSingleApply(null);
                } else {
                    Log.log("Unexpected option: " + ret);
                }
            }
        }
    }
    return Status.OK_STATUS;
}
 
Example #22
Source File: CommitCommentArea.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
void openCommentTemplatesPreferencePage() {
	PreferencesUtil.createPreferenceDialogOn(
			null,
			"org.tigris.subversion.subclipse.ui.CommentTemplatesPreferences", //$NON-NLS-1$
			new String[] { "org.tigris.subversion.subclipse.ui.CommentTemplatesPreferences" }, //$NON-NLS-1$
			null).open();
	fComboBox.setCommentTemplates(
			SVNUIPlugin.getPlugin().getRepositoryManager().getCommentsManager().getCommentTemplates());
}
 
Example #23
Source File: NewTypeWizardPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
private void typePageLinkActivated() {
	IJavaProject project= getJavaProject();
	if (project != null) {
		PreferenceDialog dialog= PreferencesUtil.createPropertyDialogOn(getShell(), project.getProject(), CodeTemplatePreferencePage.PROP_ID, null, null);
		dialog.open();
	} else {
		String title= NewWizardMessages.NewTypeWizardPage_configure_templates_title;
		String message= NewWizardMessages.NewTypeWizardPage_configure_templates_message;
		MessageDialog.openInformation(getShell(), title, message);
	}
}
 
Example #24
Source File: OpenSarosPreferencesHandler.java    From saros with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
  PreferenceDialog pref =
      PreferencesUtil.createPreferenceDialogOn(null, "saros.preferences", null, null);
  if (pref != null) pref.open();

  return null;
}
 
Example #25
Source File: NewJavaProjectWizardPageOne.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public void widgetDefaultSelected(SelectionEvent e) {
	String jreID= BuildPathSupport.JRE_PREF_PAGE_ID;
	String eeID= BuildPathSupport.EE_PREF_PAGE_ID;
	String complianceId= CompliancePreferencePage.PREF_ID;
	Map<String, Boolean> data= new HashMap<String, Boolean>();
	data.put(PropertyAndPreferencePage.DATA_NO_LINK, Boolean.TRUE);
	PreferencesUtil.createPreferenceDialogOn(getShell(), jreID, new String[] { jreID, complianceId , eeID }, data).open();

	handlePossibleJVMChange();
	fDetectGroup.handlePossibleJVMChange();
}
 
Example #26
Source File: SelfEncapsulateFieldInputPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
private void doOpenPreference() {
	String id= CodeStylePreferencePage.PROP_ID;
	IJavaProject project= fRefactoring.getField().getJavaProject();

	String[] relevantOptions= getRelevantOptions(project);

	int open= PreferencesUtil.createPropertyDialogOn(getShell(), project, id, new String[] { id }, null).open();
	if (open == Window.OK && !Arrays.equals(relevantOptions, getRelevantOptions(project))) { // relevant options changes
		fRefactoring.reinitialize();
		fGetterName.setText(fRefactoring.getGetterName());
		fSetterName.setText(fRefactoring.getSetterName());
	}
}
 
Example #27
Source File: PreferencesPageHandler.java    From txtUML with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * 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;
}
 
Example #28
Source File: PropertyAndPreferencePage.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
protected final void openProjectProperties(IProject project, Object data)
{
	String id = getPropertyPageId();
	if (id != null)
	{
		PreferencesUtil.createPropertyDialogOn(getShell(), project, id, new String[] { id }, data).open();
	}
}
 
Example #29
Source File: ChooseGhidraInstallationWizardPage.java    From ghidra with Apache License 2.0 5 votes vote down vote up
@Override
public void createControl(Composite parent) {

	Composite container = new Composite(parent, SWT.NULL);
	container.setLayout(new GridLayout(3, false));

	Label ghidraInstallDirLabel = new Label(container, SWT.NULL);
	ghidraInstallDirLabel.setText("Ghidra installation:");
	ghidraInstallDirCombo = new Combo(container, SWT.DROP_DOWN | SWT.READ_ONLY);
	ghidraInstallDirCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	populateGhidraInstallationCombo();
	ghidraInstallDirCombo.addModifyListener(evt -> validate());
	ghidraInstallDirCombo.setToolTipText("The wizard requires a Ghidra installation to be " +
		"selected.  Click the + button to add or manage Ghidra installations.");
	addGhidraInstallDirButton = new Button(container, SWT.BUTTON1);
	addGhidraInstallDirButton.setText("+");
	addGhidraInstallDirButton.setToolTipText("Adds/manages Ghidra installations.");
	addGhidraInstallDirButton.addListener(SWT.Selection, evt -> {
		PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(null,
			GhidraProjectCreatorPreferencePage.class.getName(), null, null);
		dialog.open();
		populateGhidraInstallationCombo();
		validate();
	});

	validate();
	setControl(container);
}
 
Example #30
Source File: PropToPrefLinkArea.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
public PropToPrefLinkArea(Composite parent, int style, final String pageId, String message, final Shell shell,
		final Object pageData)
{
	/*
	 * breaking new ground yet again - want to link between property and preference paes. ie: project specific debug
	 * engine options to general debugging options
	 */
	pageLink = new Link(parent, style);

	IPreferenceNode node = getPreferenceNode(pageId);
	String result;
	if (node == null)
	{
		result = NLS.bind(WorkbenchMessages.PreferenceNode_NotFound, pageId);
	}
	else
	{
		result = MessageFormat.format(message, node.getLabelText());

		// only add the selection listener if the node is found
		pageLink.addSelectionListener(new SelectionAdapter()
		{

			public void widgetSelected(SelectionEvent e)
			{
				PreferencesUtil.createPreferenceDialogOn(shell, pageId, new String[] { pageId }, pageData).open();
			}

		});
	}
	pageLink.setText(result);

}