本文整理汇总了Java中com.intellij.openapi.options.ShowSettingsUtil类的典型用法代码示例。如果您正苦于以下问题:Java ShowSettingsUtil类的具体用法?Java ShowSettingsUtil怎么用?Java ShowSettingsUtil使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ShowSettingsUtil类属于com.intellij.openapi.options包,在下文中一共展示了ShowSettingsUtil类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: applyFix
import com.intellij.openapi.options.ShowSettingsUtil; //导入依赖的package包/类
@Override
public void applyFix(@NotNull final Project project, @NotNull final ProblemDescriptor descriptor) {
final FileTemplateConfigurable configurable = new FileTemplateConfigurable(project);
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
configurable.setTemplate(myTemplateToEdit, null);
boolean ok = ShowSettingsUtil.getInstance().editConfigurable(project, configurable);
if (ok) {
WriteCommandAction.runWriteCommandAction(project, new Runnable() {
@Override
public void run() {
FileTemplateManager.getInstance(project).saveAllTemplates();
myReplaceTemplateFix.applyFix(project, descriptor);
}
});
}
}
});
}
示例2: createOptionsPanel
import com.intellij.openapi.options.ShowSettingsUtil; //导入依赖的package包/类
@Override
public JComponent createOptionsPanel() {
final JButton editDependencies = new JButton(InspectionsBundle.message("inspection.dependency.configure.button.text"));
editDependencies.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Project project = CommonDataKeys.PROJECT.getData(DataManager.getInstance().getDataContext(editDependencies));
if (project == null) project = ProjectManager.getInstance().getDefaultProject();
ShowSettingsUtil.getInstance().editConfigurable(editDependencies, new DependencyConfigurable(project));
}
});
JPanel depPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
depPanel.add(editDependencies);
return depPanel;
}
示例3: excludeFromImport
import com.intellij.openapi.options.ShowSettingsUtil; //导入依赖的package包/类
public static void excludeFromImport(final Project project, final String prefix) {
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
if (project.isDisposed()) return;
final AutoImportOptionsConfigurable configurable = new AutoImportOptionsConfigurable(project);
ShowSettingsUtil.getInstance().editConfigurable(project, configurable, new Runnable() {
@Override
public void run() {
final JavaAutoImportOptions options = ContainerUtil.findInstance(configurable.getConfigurables(), JavaAutoImportOptions.class);
options.addExcludePackage(prefix);
}
});
}
});
}
示例4: showFacetSettingsDialog
import com.intellij.openapi.options.ShowSettingsUtil; //导入依赖的package包/类
public static boolean showFacetSettingsDialog(@NotNull final Facet facet,
@Nullable final String tabNameToSelect) {
final Project project = facet.getModule().getProject();
final ProjectStructureConfigurable config = ProjectStructureConfigurable.getInstance(project);
return ShowSettingsUtil.getInstance().editConfigurable(project, config, new Runnable() {
@Override
public void run() {
final ModuleStructureConfigurable modulesConfig = config.getModulesConfig();
config.select(facet, true).doWhenDone(new Runnable() {
@Override
public void run() {
if (tabNameToSelect != null) {
FacetEditorImpl facetEditor = modulesConfig.getFacetConfigurator().getOrCreateEditor(facet);
facetEditor.setSelectedTabName(tabNameToSelect);
}
}
});
}
});
}
示例5: hyperlinkActivated
import com.intellij.openapi.options.ShowSettingsUtil; //导入依赖的package包/类
@Override
protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
ExternalSystemManager<?, ?, ?, ?, ?> manager;
if (myLinkedProjectPath == null ||
!((manager = ExternalSystemApiUtil.getManager(mySystemId)) instanceof ExternalSystemConfigurableAware)) {
ShowSettingsUtil.getInstance().showSettingsDialog(myProject, mySystemId.getReadableName());
return;
}
final Configurable configurable = ((ExternalSystemConfigurableAware)manager).getConfigurable(myProject);
if(configurable instanceof AbstractExternalSystemConfigurable) {
ShowSettingsUtil.getInstance().editConfigurable(myProject, configurable, new Runnable() {
@Override
public void run() {
((AbstractExternalSystemConfigurable)configurable).selectProject(myLinkedProjectPath);
}
});
}
}
示例6: hyperlinkUpdate
import com.intellij.openapi.options.ShowSettingsUtil; //导入依赖的package包/类
@Override
public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
final String description = event.getDescription();
if ("enable".equals(description)) {
KeyboardSettingsExternalizable.getInstance().setNonEnglishKeyboardSupportEnabled(true);
}
else if ("settings".equals(description)) {
final ShowSettingsUtil util = ShowSettingsUtil.getInstance();
IdeFrame ideFrame = WindowManagerEx.getInstanceEx().findFrameFor(null);
//util.editConfigurable((JFrame)ideFrame, new StatisticsConfigurable(true));
util.showSettingsDialog(ideFrame.getProject(), KeymapPanel.class);
}
NotificationsConfiguration.getNotificationsConfiguration().changeSettings(LOCALIZATION_GROUP_DISPLAY_ID, NotificationDisplayType.NONE, false, false);
notification.expire();
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:KeyboardInternationalizationNotificationManager.java
示例7: actionPerformed
import com.intellij.openapi.options.ShowSettingsUtil; //导入依赖的package包/类
public void actionPerformed(@NotNull AnActionEvent e) {
Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());
if (project == null) {
project = ProjectManager.getInstance().getDefaultProject();
}
final long startTime = System.nanoTime();
SwingUtilities.invokeLater(new Runnable() {
public void run() {
final long endTime = System.nanoTime();
if (ApplicationManagerEx.getApplicationEx().isInternal()) {
System.out.println("Displaying settings dialog took " + ((endTime - startTime) / 1000000) + " ms");
}
}
});
ShowSettingsUtil.getInstance().showSettingsDialog(project, ShowSettingsUtilImpl.getConfigurableGroups(project, true));
}
示例8: createForcePushInfoLabel
import com.intellij.openapi.options.ShowSettingsUtil; //导入依赖的package包/类
@NotNull
private JComponent createForcePushInfoLabel() {
JPanel text = new JPanel();
text.setLayout(new BoxLayout(text, BoxLayout.X_AXIS));
JLabel label = new JLabel("You can enable and configure Force Push in " + ShowSettingsUtil.getSettingsMenuName() + ".");
label.setEnabled(false);
label.setFont(JBUI.Fonts.smallFont());
text.add(label);
ActionLink here = new ActionLink("Configure", new AnAction() {
@Override
public void actionPerformed(AnActionEvent e) {
Project project = myController.getProject();
VcsPushDialog.this.doCancelAction(e.getInputEvent());
ShowSettingsUtilImpl.showSettingsDialog(project, "vcs.Git", "force push");
}
});
here.setFont(JBUI.Fonts.smallFont());
text.add(here);
return JBUI.Panels.simplePanel().addToRight(text).withBorder(JBUI.Borders.emptyBottom(4));
}
示例9: notifyAboutSyncedBranches
import com.intellij.openapi.options.ShowSettingsUtil; //导入依赖的package包/类
private void notifyAboutSyncedBranches() {
String description =
"You have several " + myVcs.getDisplayName() + " roots in the project and they all are checked out at the same branch. " +
"We've enabled synchronous branch control for the project. <br/>" +
"If you wish to control branches in different roots separately, " +
"you may <a href='settings'>disable</a> the setting.";
NotificationListener listener = new NotificationListener() {
@Override
public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
ShowSettingsUtil.getInstance().showSettingsDialog(myProject, myVcs.getConfigurable().getDisplayName());
if (myVcsSettings.getSyncSetting() == DvcsSyncSettings.Value.DONT_SYNC) {
notification.expire();
}
}
}
};
VcsNotifier.getInstance(myProject).notifyImportantInfo("Synchronous branch control enabled", description, listener);
}
示例10: hyperlinkActivated
import com.intellij.openapi.options.ShowSettingsUtil; //导入依赖的package包/类
@Override
protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
if (event.getDescription().equals("configure") && !myProject.isDisposed()) {
ShowSettingsUtil.getInstance().showSettingsDialog(myProject, ActionsBundle.message("group.VcsGroup.text"));
Collection<VcsRootError> errorsAfterPossibleFix = getInstance(myProject).scan();
if (errorsAfterPossibleFix.isEmpty() && !notification.isExpired()) {
notification.expire();
}
}
else if (event.getDescription().equals("ignore")) {
mySettings.addIgnoredUnregisteredRoots(ContainerUtil.map(myImportantUnregisteredRoots, PATH_FROM_ROOT_ERROR));
notification.expire();
}
else if (event.getDescription().equals("add")) {
List<VcsDirectoryMapping> mappings = myVcsManager.getDirectoryMappings();
for (VcsRootError root : myImportantUnregisteredRoots) {
mappings = VcsUtil.addMapping(mappings, root.getMapping(), root.getVcsKey().getName());
}
myVcsManager.setDirectoryMappings(mappings);
}
}
示例11: invoke
import com.intellij.openapi.options.ShowSettingsUtil; //导入依赖的package包/类
@Override
public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
final InspectionProjectProfileManager profileManager = InspectionProjectProfileManager.getInstance(project);
final ProjectInspectionToolsConfigurable configurable =
new ProjectInspectionToolsConfigurable(InspectionProfileManager.getInstance(), profileManager) {
@Override
protected boolean acceptTool(InspectionToolWrapper entry) {
return super.acceptTool(entry) && entry.isCleanupTool();
}
@Override
public String getDisplayName() {
return CodeCleanupAction.CODE_CLEANUP_INSPECTIONS_DISPLAY_NAME;
}
};
ShowSettingsUtil.getInstance().editConfigurable(project, configurable);
}
示例12: showCodeStyleSettings
import com.intellij.openapi.options.ShowSettingsUtil; //导入依赖的package包/类
/**
* Shows code style settings suitable for the project passed. I.e. it shows project code style page if one
* is configured to use own code style scheme or global one in other case.
* @param project
* @return Returns true if settings were modified during editing session.
*/
@Override
public boolean showCodeStyleSettings(Project project, final Class pageToSelect) {
CodeStyleSettingsManager settingsManager = CodeStyleSettingsManager.getInstance(project);
CodeStyleSettings savedSettings = settingsManager.getCurrentSettings().clone();
final CodeStyleSchemesConfigurable configurable = new CodeStyleSchemesConfigurable(project);
ShowSettingsUtil.getInstance().editConfigurable(project, configurable, new Runnable() {
@Override
public void run() {
if (pageToSelect != null) {
configurable.selectPage(pageToSelect);
}
}
});
return !savedSettings.equals(settingsManager.getCurrentSettings());
}
示例13: actionPerformed
import com.intellij.openapi.options.ShowSettingsUtil; //导入依赖的package包/类
@Override
public void actionPerformed(final AnActionEvent e) {
Project project = e.getData(CommonDataKeys.PROJECT);
if (project == null) return;
final VirtualFile virtualFile = e.getData(CommonDataKeys.VIRTUAL_FILE);
final TemplateDataLanguageConfigurable configurable = new TemplateDataLanguageConfigurable(project);
ShowSettingsUtil.getInstance().editConfigurable(project, configurable, new Runnable() {
@Override
public void run() {
if (virtualFile != null) {
configurable.selectFile(virtualFile);
}
}
});
}
示例14: createPopupActionGroup
import com.intellij.openapi.options.ShowSettingsUtil; //导入依赖的package包/类
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));
}
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;
}
示例15: TitleIndex
import com.intellij.openapi.options.ShowSettingsUtil; //导入依赖的package包/类
TitleIndex() {
String gotoClass = KeymapUtil.getFirstKeyboardShortcutText(ActionManager.getInstance().getAction("GotoClass"));
gotoClassTitle = StringUtil.isEmpty(gotoClass) ? "Classes" : "Classes (" + gotoClass + ")";
String gotoFile = KeymapUtil.getFirstKeyboardShortcutText(ActionManager.getInstance().getAction("GotoFile"));
gotoFileTitle = StringUtil.isEmpty(gotoFile) ? "Files" : "Files (" + gotoFile + ")";
String gotoAction = KeymapUtil.getFirstKeyboardShortcutText(ActionManager.getInstance().getAction("GotoAction"));
gotoActionTitle = StringUtil.isEmpty(gotoAction) ? "Actions" : "Actions (" + gotoAction + ")";
String gotoSettings = KeymapUtil.getFirstKeyboardShortcutText(ActionManager.getInstance().getAction("ShowSettings"));
gotoSettingsTitle = StringUtil.isEmpty(gotoAction) ? ShowSettingsUtil.getSettingsMenuName() : ShowSettingsUtil.getSettingsMenuName() + " (" + gotoSettings + ")";
String gotoRecentFiles = KeymapUtil.getFirstKeyboardShortcutText(ActionManager.getInstance().getAction("RecentFiles"));
gotoRecentFilesTitle = StringUtil.isEmpty(gotoRecentFiles) ? "Recent Files" : "Recent Files (" + gotoRecentFiles + ")";
String gotoSymbol = KeymapUtil.getFirstKeyboardShortcutText(ActionManager.getInstance().getAction("GotoSymbol"));
gotoSymbolTitle = StringUtil.isEmpty(gotoSymbol) ? "Symbols" : "Symbols (" + gotoSymbol + ")";
String gotoRunConfiguration = KeymapUtil.getFirstKeyboardShortcutText(ActionManager.getInstance().getAction("ChooseDebugConfiguration"));
if (StringUtil.isEmpty(gotoRunConfiguration)) {
gotoRunConfiguration = KeymapUtil.getFirstKeyboardShortcutText(ActionManager.getInstance().getAction("ChooseRunConfiguration"));
}
gotoRunConfigurationsTitle = StringUtil.isEmpty(gotoRunConfiguration) ? "Run Configurations" : "Run Configurations (" + gotoRunConfiguration + ")";
String gotoStructure = KeymapUtil.getFirstKeyboardShortcutText(ActionManager.getInstance().getAction("FileStructurePopup"));
gotoStructureTitle = StringUtil.isEmpty(gotoStructure) ? "File Structure" : "File Structure (" + gotoStructure + ")";
}