use of org.eclipse.jface.preference.PreferenceDialog in project tesb-studio-se by Talend.
the class OpenRuntimePrefsAction method run.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
public void run() {
PreferenceDialog dlg = new PreferenceDialog(Display.getDefault().getActiveShell(), PlatformUI.getWorkbench().getPreferenceManager());
dlg.setSelectedNode(RunContainerPreferencePage.ID);
dlg.open();
}
use of org.eclipse.jface.preference.PreferenceDialog in project tdi-studio-se by Talend.
the class ProjectSettingDialog method open.
public void open(final String pageId) {
PreferenceManager manager = getNodeManager();
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
final PreferenceDialog dialog = new ProjectSettingsPreferenceDialog(shell, manager);
BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
@Override
public void run() {
if (StringUtils.isNotEmpty(pageId)) {
dialog.setSelectedNode(pageId);
}
dialog.create();
dialog.getShell().setText(TITLE);
dialog.getShell().setSize(DEFAULT_SIZE);
dialog.open();
}
});
}
use of org.eclipse.jface.preference.PreferenceDialog in project bndtools by bndtools.
the class ProjectTemplateSelectionWizardPage method createHeaderControl.
@Override
protected Control createHeaderControl(Composite parent) {
Composite composite;
Workspace workspace = Central.getWorkspaceIfPresent();
if (workspace == null || workspace.isDefaultWorkspace()) {
composite = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout(2, false);
layout.marginWidth = 0;
layout.marginHeight = 0;
layout.marginBottom = 15;
layout.verticalSpacing = 15;
composite.setLayout(layout);
Label lblWarning = new Label(composite, SWT.NONE);
warningImg = Icons.desc("warning.big").createImage(parent.getDisplay());
lblWarning.setImage(warningImg);
Link link = new Link(composite, SWT.NONE);
link.setText("WARNING! The bnd workspace has not been configured. <a href=\"#workspace\">Create a workspace first</a> \n or configure a <a href=\"#prefs\">Template Repository</a> in Bndtools Preferences.");
link.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent ev) {
WizardDialog dialog = (WizardDialog) getContainer();
dialog.close();
if ("#workspace".equals(ev.text)) {
// We are going to open the New Workspace wizard in a new dialog.
// If that wizard completes successfully then we can reopen the New Project wizard.
WorkspaceSetupWizard workspaceWizard = new WorkspaceSetupWizard();
workspaceWizard.init(PlatformUI.getWorkbench(), StructuredSelection.EMPTY);
dialog = new WizardDialog(dialog.getShell(), workspaceWizard);
if (Window.OK == dialog.open()) {
try {
NewBndProjectWizard projectWizard = new NewBndProjectWizardFactory().create();
projectWizard.init(PlatformUI.getWorkbench(), StructuredSelection.EMPTY);
new WizardDialog(dialog.getShell(), projectWizard).open();
} catch (CoreException e) {
Plugin.getDefault().getLog().log(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, "Unable to open New Bnd Project wizard", e));
}
}
} else if ("#prefs".equals(ev.text)) {
// Open the preference dialog with the template repositories page open.
// We can't reopen the New Project wizard after because we don't know that the user changed anything.
PreferenceDialog prefsDialog = PreferencesUtil.createPreferenceDialogOn(getShell(), "bndtools.prefPages.repos", null, null);
prefsDialog.open();
}
}
});
GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
link.setLayoutData(gd);
// ControlDecoration decor = new ControlDecoration(link, SWT.LEFT, composite);
// decor.setImage(FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_WARNING).getImage());
Label separator = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
separator.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));
} else {
// There is a workspace, just return null (no controls will be inserted into the panel).
composite = null;
}
return composite;
}
use of org.eclipse.jface.preference.PreferenceDialog in project bndtools by bndtools.
the class NewTypeWizardPage method typePageLinkActivated.
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);
}
}
Aggregations