List of usage examples for com.intellij.openapi.ui DialogBuilder setHelpId
public void setHelpId(@NonNls String helpId)
From source file:com.intellij.lang.ant.config.impl.configuration.BuildFilePropertiesPanel.java
License:Apache License
private boolean showDialog() { DialogBuilder builder = new DialogBuilder(myBuildFile.getProject()); builder.setCenterPanel(myForm.myWholePanel); builder.setDimensionServiceKey(DIMENSION_SERVICE_KEY); builder.setPreferredFocusComponent(myForm.getPreferedFocusComponent()); builder.setTitle(AntBundle.message("build.file.properties.dialog.title")); builder.removeAllActions();/*from w ww . ja va2s .co m*/ builder.addOkAction(); builder.addCancelAction(); builder.setHelpId("reference.dialogs.buildfileproperties"); boolean isOk = builder.show() == DialogWrapper.OK_EXIT_CODE; if (isOk) { apply(); } beforeClose(); return isOk; }
From source file:net.stevechaloner.intellijad.actions.ViewMemoryFileSystemAction.java
License:Apache License
/** {@inheritDoc} */ public void actionPerformed(AnActionEvent e) { Project project = DataKeys.PROJECT.getData(e.getDataContext()); if (project != null) { DialogBuilder builder = new DialogBuilder(project); builder.setTitle(IntelliJadResourceBundle.message("plugin.IntelliJad.name")); builder.addCloseButton();//from w w w . ja v a 2s . co m MemoryFileSystemManager mfsPopup = new MemoryFileSystemManager( DataKeys.PROJECT.getData(e.getDataContext())); builder.setCenterPanel(mfsPopup.getRoot()); builder.setHelpId(IntelliJadConstants.CONFIGURATION_HELP_TOPIC); builder.setTitle(IntelliJadResourceBundle.message("message.intellijad-memory-fs-manager")); builder.show(); } }
From source file:org.intellij.plugins.intelliLang.inject.AbstractLanguageInjectionSupport.java
License:Apache License
@Nullable protected static BaseInjection showDefaultInjectionUI(final Project project, BaseInjection injection) { final BaseInjectionPanel panel = new BaseInjectionPanel(injection, project); panel.reset();/*ww w . ja v a 2s. co m*/ final DialogBuilder builder = new DialogBuilder(project); LanguageInjectionSupport support = InjectorUtils.findInjectionSupport(injection.getSupportId()); if (support != null && support instanceof AbstractLanguageInjectionSupport) { builder.setHelpId(((AbstractLanguageInjectionSupport) support).getHelpId()); } builder.addOkAction(); builder.addCancelAction(); builder.setDimensionServiceKey("#org.intellij.plugins.intelliLang.inject.config.ui.BaseInjectionDialog"); builder.setCenterPanel(panel.getComponent()); builder.setTitle(EditInjectionSettingsAction.EDIT_INJECTION_TITLE); builder.setOkOperation(new Runnable() { public void run() { try { panel.apply(); builder.getDialogWrapper().close(DialogWrapper.OK_EXIT_CODE); } catch (Exception e) { final Throwable cause = e.getCause(); final String message = e.getMessage() + (cause != null ? "\n " + cause.getMessage() : ""); Messages.showErrorDialog(project, message, "Unable to Save"); } } }); if (builder.show() == DialogWrapper.OK_EXIT_CODE) { return injection; } return null; }
From source file:org.intellij.plugins.intelliLang.inject.java.JavaLanguageInjectionSupport.java
License:Apache License
private static BaseInjection showInjectionUI(final Project project, final MethodParameterInjection methodParameterInjection) { final AbstractInjectionPanel panel = new MethodParameterPanel(methodParameterInjection, project); panel.reset();//from w ww . java 2s. c o m final DialogBuilder builder = new DialogBuilder(project); builder.setHelpId("reference.settings.injection.language.injection.settings.java.parameter"); builder.addOkAction(); builder.addCancelAction(); builder.setCenterPanel(panel.getComponent()); builder.setTitle(EditInjectionSettingsAction.EDIT_INJECTION_TITLE); builder.setOkOperation(new Runnable() { public void run() { panel.apply(); builder.getDialogWrapper().close(DialogWrapper.OK_EXIT_CODE); } }); if (builder.show() == DialogWrapper.OK_EXIT_CODE) { return new BaseInjection(methodParameterInjection.getSupportId()).copyFrom(methodParameterInjection); } return null; }
From source file:org.intellij.plugins.intelliLang.inject.xml.XmlLanguageInjectionSupport.java
License:Apache License
@Nullable private static BaseInjection showInjectionUI(final Project project, final BaseInjection xmlInjection) { final DialogBuilder builder = new DialogBuilder(project); final AbstractInjectionPanel panel; if (xmlInjection instanceof XmlTagInjection) { panel = new XmlTagPanel((XmlTagInjection) xmlInjection, project); builder.setHelpId("reference.settings.injection.language.injection.settings.xml.tag"); } else if (xmlInjection instanceof XmlAttributeInjection) { panel = new XmlAttributePanel((XmlAttributeInjection) xmlInjection, project); builder.setHelpId("reference.settings.injection.language.injection.settings.xml.attribute"); } else/* w ww.ja va 2 s . c o m*/ throw new AssertionError(); panel.reset(); builder.addOkAction(); builder.addCancelAction(); builder.setCenterPanel(panel.getComponent()); builder.setTitle(EditInjectionSettingsAction.EDIT_INJECTION_TITLE); builder.setOkOperation(new Runnable() { public void run() { panel.apply(); builder.getDialogWrapper().close(DialogWrapper.OK_EXIT_CODE); } }); if (builder.show() == DialogWrapper.OK_EXIT_CODE) { return new AbstractTagInjection().copyFrom(xmlInjection); } return null; }
From source file:org.napile.idea.thermit.config.impl.configuration.BuildFilePropertiesPanel.java
License:Apache License
private boolean showDialog() { DialogBuilder builder = new DialogBuilder(myBuildFile.getProject()); builder.setCenterPanel(myForm.myWholePanel); builder.setDimensionServiceKey(DIMENSION_SERVICE_KEY); builder.setPreferedFocusComponent(myForm.getPreferedFocusComponent()); builder.setTitle(ThermitBundle.message("build.file.properties.dialog.title")); builder.removeAllActions();/* www. j a va2 s . com*/ builder.addOkAction(); builder.addCancelAction(); builder.setHelpId("reference.dialogs.buildfileproperties"); boolean isOk = builder.show() == DialogWrapper.OK_EXIT_CODE; if (isOk) { apply(); } beforeClose(); return isOk; }