List of usage examples for com.intellij.openapi.options ShowSettingsUtil editConfigurable
public abstract boolean editConfigurable(@Nullable Component parent, @NotNull String displayName);
From source file:com.atlassian.theplugin.idea.action.ShowProjectSettingsAction.java
License:Apache License
@Override public void actionPerformed(AnActionEvent event) { Project project = IdeaHelper.getCurrentProject(event); if (project != null) { ProjectConfigurationComponent component = project.getComponent(ProjectConfigurationComponent.class); component.load();/*from w w w.ja va 2 s. c om*/ ServerData server = event.getData(Constants.SERVER_KEY); if (server != null) { component.setSelectedServer(server); } else { PluginToolWindow toolWindow = IdeaHelper.getProjectComponent(project, PluginToolWindow.class); if (toolWindow != null) { if (toolWindow.getSelectedContent() != null) { component.setSelectedServer(findBestServerToSelect(toolWindow.getSelectedContent(), IdeaHelper.getProjectCfgManager(event))); } } } final ShowSettingsUtil settingsUtil = ShowSettingsUtil.getInstance(); if (settingsUtil != null) { settingsUtil.editConfigurable(project, component); } } }
From source file:com.atlassian.theplugin.idea.config.ProjectConfigurationComponent.java
License:Apache License
public static boolean addDirectClickedServer(final Project project, final String serverUrl, ServerType serverType) {//from ww w . ja va2 s. c om ProjectConfigurationComponent component = project.getComponent(ProjectConfigurationComponent.class); ProjectConfiguration configurationClone = component.getProjectConfigurationClone(); ServerIdImpl id = new ServerIdImpl(); String name = serverUrl; if (name.contains("://")) { name = name.substring(name.indexOf("://") + 3); if (name.contains("/")) { name = name.substring(0, name.indexOf("/")); } } ServerCfg serverCfg = null; final ServerData data; //beautiful switch: :/ switch (serverType) { case BAMBOO_SERVER: serverCfg = new BambooServerCfg(name, id); data = new BambooServerData((BambooServerCfg) serverCfg); break; case JIRA_SERVER: serverCfg = new JiraServerCfg(name, id, true); data = new JiraServerData(serverCfg); break; default: throw new AssertionError("switch not implemented for [" + serverType + "]"); } serverCfg.setUrl(serverUrl); serverCfg.setUseDefaultCredentials(true); configurationClone.getServers().add(serverCfg); component.updateConfiguration(configurationClone); component.setSelectedServer(data); final ShowSettingsUtil settingsUtil = ShowSettingsUtil.getInstance(); if (settingsUtil != null) { boolean hasClickedOkButton = settingsUtil.editConfigurable(project, component); if (!hasClickedOkButton) { configurationClone = component.getProjectConfigurationClone(); ServerCfg toRemoveCfg = configurationClone.getServerCfg(id); configurationClone.getServers().remove(toRemoveCfg); component.updateConfiguration(configurationClone); } return hasClickedOkButton; } return false; }
From source file:com.echologic.xfiles.EditConfigurationsAction.java
License:Open Source License
public void actionPerformed(AnActionEvent event) { DataContext context = event.getDataContext(); Project project = (Project) context.getData(DataConstants.PROJECT); XFilesConfigurable configurable = (XFilesConfigurable) project.getComponent(XFilesConfigurable.class); ShowSettingsUtil util = ShowSettingsUtil.getInstance(); util.editConfigurable(project, configurable); }
From source file:com.google.cloud.tools.intellij.stats.UsageTrackerNotification.java
License:Open Source License
/** * Show the notification panel./*from w w w. j ava 2s . c om*/ */ public void showNotification() { NotificationListener listener = new NotificationListener() { @Override public void hyperlinkUpdate(Notification notification, HyperlinkEvent event) { if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { final String description = event.getDescription(); if ("allow".equals(description)) { usageTrackerManager.setTrackingPreference(true); notification.expire(); } else if ("decline".equals(description)) { UsageTrackerManager usageTrackerManager = UsageTrackerManager.getInstance(); usageTrackerManager.setTrackingPreference(false); notification.expire(); } else if ("policy".equals(description)) { try { BrowserUtil.browse(new URL(UsageTrackerPanel.PRIVACY_POLICY_URL)); } catch (MalformedURLException ex) { LOG.error(ex); } notification.expire(); } else if ("settings".equals(description)) { final ShowSettingsUtil util = ShowSettingsUtil.getInstance(); IdeFrame ideFrame = WindowManagerEx.getInstanceEx().findFrameFor(null); util.editConfigurable((JFrame) ideFrame, new GoogleSettingsConfigurable()); notification.expire(); } } } }; Notification notification = new Notification(TrackerMessageBundle.message("notification.group.display.id"), TrackerMessageBundle.message("notification.popup.title"), TrackerMessageBundle.message("notification.popup.content"), NotificationType.INFORMATION, listener); Notifications.Bus.notify(notification); }
From source file:com.intellij.codeInsight.actions.ReformatCodeAction.java
License:Apache License
public static void updateShowDialogSetting(LayoutCodeDialog dialog, String title) { if (dialog.isDoNotAskMe()) { Notifications.Bus.notify(new Notification("Reformat Code", title, "<html>You can re-enable the dialog on the <a href=''>IDE Settings -> Editor</a> pane</html>", NotificationType.INFORMATION, new NotificationListener() { @Override/*from www. j a va 2 s .c o m*/ public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent e) { if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { final ShowSettingsUtil util = ShowSettingsUtil.getInstance(); IdeFrame ideFrame = WindowManagerEx.getInstanceEx().findFrameFor(null); util.editConfigurable((JFrame) ideFrame, new EditorOptions()); } } })); } }
From source file:com.intellij.ide.actions.CustomizeUIAction.java
License:Apache License
public void actionPerformed(AnActionEvent e) { final Project project = e.getData(CommonDataKeys.PROJECT); final ShowSettingsUtil util = ShowSettingsUtil.getInstance(); util.editConfigurable(project, new CustomizationConfigurable()); }
From source file:com.intellij.ide.todo.SetTodoFilterAction.java
License:Apache License
public static DefaultActionGroup createPopupActionGroup(final Project project, final TodoPanelSettings settings, Consumer<TodoFilter> todoFilterConsumer) { TodoFilter[] filters = TodoConfiguration.getInstance().getTodoFilters(); DefaultActionGroup group = new DefaultActionGroup(); group.add(new TodoFilterApplier(IdeBundle.message("action.todo.show.all"), IdeBundle.message("action.description.todo.show.all"), null, settings, todoFilterConsumer)); for (TodoFilter filter : filters) { group.add(new TodoFilterApplier(filter.getName(), null, filter, settings, todoFilterConsumer)); }//w ww . ja v a 2 s. c om group.addSeparator(); group.add(new AnAction(IdeBundle.message("action.todo.edit.filters"), IdeBundle.message("action.todo.edit.filters"), AllIcons.General.Settings) { @Override public void actionPerformed(AnActionEvent e) { final ShowSettingsUtil util = ShowSettingsUtil.getInstance(); util.editConfigurable(project, new TodoConfigurable()); } }); return group; }
From source file:org.intellij.images.options.impl.OptionsConfigurabe.java
License:Apache License
public static void show(Project project) { final ShowSettingsUtil util = ShowSettingsUtil.getInstance(); util.editConfigurable(project, new OptionsConfigurabe()); }