本文整理汇总了Java中com.intellij.ide.IdeBundle类的典型用法代码示例。如果您正苦于以下问题:Java IdeBundle类的具体用法?Java IdeBundle怎么用?Java IdeBundle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IdeBundle类属于com.intellij.ide包,在下文中一共展示了IdeBundle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addRecordedMacroWithName
import com.intellij.ide.IdeBundle; //导入依赖的package包/类
private void addRecordedMacroWithName(@Nullable String macroName) {
if (macroName != null) {
myRecordingMacro.setName(macroName);
myMacros.add(myRecordingMacro);
myRecordingMacro = null;
}
else {
for (int i = 0; i < myMacros.size(); i++) {
ActionMacro macro = myMacros.get(i);
if (IdeBundle.message("macro.noname").equals(macro.getName())) {
myMacros.set(i, myRecordingMacro);
myRecordingMacro = null;
break;
}
}
if (myRecordingMacro != null) {
myMacros.add(myRecordingMacro);
myRecordingMacro = null;
}
}
}
示例2: initTree
import com.intellij.ide.IdeBundle; //导入依赖的package包/类
@Override
protected void initTree() {
myTree.getSelectionModel().addTreeSelectionListener(new TreeSelectionListener() {
@Override
public void valueChanged(TreeSelectionEvent e) {
final TreePath path = e.getOldLeadSelectionPath();
if (path != null) {
final MyNode node = (MyNode)path.getLastPathComponent();
final NamedConfigurable namedConfigurable = node.getConfigurable();
if (namedConfigurable instanceof ScopeConfigurable) {
((ScopeConfigurable)namedConfigurable).cancelCurrentProgress();
}
}
}
});
super.initTree();
myTree.setShowsRootHandles(false);
new TreeSpeedSearch(myTree, new Convertor<TreePath, String>() {
@Override
public String convert(final TreePath treePath) {
return ((MyNode)treePath.getLastPathComponent()).getDisplayName();
}
}, true);
myTree.getEmptyText().setText(IdeBundle.message("scopes.no.scoped"));
}
示例3: checkReadOnlyFiles
import com.intellij.ide.IdeBundle; //导入依赖的package包/类
private boolean checkReadOnlyFiles() throws IOException {
List<File> files = getReadOnlyFiles();
if (!files.isEmpty()) {
final String message = IdeBundle.message("message.text.unlock.read.only.files",
ApplicationNamesInfo.getInstance().getFullProductName(),
getFilesString(files));
final String[] options = {CommonBundle.getContinueButtonText(), CommonBundle.getCancelButtonText()};
if (Messages.showOkCancelDialog(myMainPanel, message, IdeBundle.message("dialog.title.convert.project"), options[0], options[1], null) != Messages.OK) {
return false;
}
unlockFiles(files);
files = getReadOnlyFiles();
if (!files.isEmpty()) {
showErrorMessage(IdeBundle.message("error.message.cannot.make.files.writable", getFilesString(files)));
return false;
}
}
return true;
}
示例4: createPopupActionGroup
import com.intellij.ide.IdeBundle; //导入依赖的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;
}
示例5: actionPerformed
import com.intellij.ide.IdeBundle; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
IdeView view = e.getData(LangDataKeys.IDE_VIEW);
Project project = e.getData(CommonDataKeys.PROJECT);
if (view == null || project == null) {
return;
}
PsiDirectory directory = DirectoryChooserUtil.getOrChooseDirectory(view);
if (directory == null) return;
boolean isDirectory = !PsiDirectoryFactory.getInstance(project).isPackage(directory);
CreateDirectoryOrPackageHandler validator = new CreateDirectoryOrPackageHandler(project, directory, isDirectory,
isDirectory ? "\\/" : ".");
Messages.showInputDialog(project, isDirectory
? IdeBundle.message("prompt.enter.new.directory.name")
: IdeBundle.message("prompt.enter.new.package.name"),
isDirectory ? IdeBundle.message("title.new.directory") : IdeBundle.message("title.new.package"),
Messages.getQuestionIcon(), "", validator);
final PsiElement result = validator.getCreatedElement();
if (result != null) {
view.selectElement(result);
}
}
示例6: apply
import com.intellij.ide.IdeBundle; //导入依赖的package包/类
@Override
public void apply() throws ConfigurationException {
if (myPanel.myUseSecureConnection.isSelected() && !NetUtils.isSniEnabled()) {
boolean tooOld = !SystemInfo.isJavaVersionAtLeast("1.7");
String message = IdeBundle.message(tooOld ? "update.sni.not.available.error" : "update.sni.disabled.error");
throw new ConfigurationException(message);
}
boolean wasEnabled = mySettings.isCheckNeeded();
mySettings.setCheckNeeded(myPanel.myCheckForUpdates.isSelected());
if (wasEnabled != mySettings.isCheckNeeded()) {
UpdateCheckerComponent checker = ApplicationManager.getApplication().getComponent(UpdateCheckerComponent.class);
if (checker != null) {
if (wasEnabled) {
checker.cancelChecks();
}
else {
checker.queueNextCheck();
}
}
}
mySettings.setUpdateChannelType(myPanel.getSelectedChannelType().getCode());
mySettings.setSecureConnection(myPanel.myUseSecureConnection.isSelected());
}
示例7: insert
import com.intellij.ide.IdeBundle; //导入依赖的package包/类
private static void insert(final String fqn, final PsiElement element, final Editor editor, final QualifiedNameProvider provider) {
final Project project = editor.getProject();
if (project == null) return;
final PsiDocumentManager documentManager = PsiDocumentManager.getInstance(project);
documentManager.commitDocument(editor.getDocument());
final PsiFile file = documentManager.getPsiFile(editor.getDocument());
if (!FileModificationService.getInstance().prepareFileForWrite(file)) return;
CommandProcessor.getInstance().executeCommand(project, new Runnable() {
@Override
public void run() {
ApplicationManager.getApplication().runWriteAction(new Runnable() {
@Override
public void run() {
Document document = editor.getDocument();
documentManager.doPostponedOperationsAndUnblockDocument(document);
documentManager.commitDocument(document);
EditorModificationUtil.deleteSelectedText(editor);
provider.insertQualifiedName(fqn, element, editor, project);
}
});
}
}, IdeBundle.message("command.pasting.reference"), null);
}
示例8: editSelectedFilter
import com.intellij.ide.IdeBundle; //导入依赖的package包/类
private void editSelectedFilter() {
stopEditing();
int selectedIndex = myFiltersTable.getSelectedRow();
if (selectedIndex < 0 || selectedIndex >= myFiltersModel.getRowCount()) {
return;
}
TodoFilter sourceFilter = myFilters.get(selectedIndex);
TodoFilter filter = sourceFilter.clone();
FilterDialog dialog = new FilterDialog(myPanel, filter, selectedIndex, myFilters, myPatterns);
dialog.setTitle(IdeBundle.message("title.edit.todo.filter"));
dialog.show();
int exitCode = dialog.getExitCode();
if (DialogWrapper.OK_EXIT_CODE == exitCode) {
myFilters.set(selectedIndex, filter);
myFiltersModel.fireTableRowsUpdated(selectedIndex, selectedIndex);
myFiltersTable.getSelectionModel().setSelectionInterval(selectedIndex, selectedIndex);
}
}
示例9: editSelectedPattern
import com.intellij.ide.IdeBundle; //导入依赖的package包/类
private void editSelectedPattern() {
stopEditing();
int selectedIndex = myPatternsTable.getSelectedRow();
if (selectedIndex < 0 || selectedIndex >= myPatternsModel.getRowCount()) {
return;
}
TodoPattern sourcePattern = myPatterns.get(selectedIndex);
TodoPattern pattern = sourcePattern.clone();
PatternDialog dialog = new PatternDialog(myPanel, pattern);
dialog.setTitle(IdeBundle.message("title.edit.todo.pattern"));
if (!dialog.showAndGet()) {
return;
}
myPatterns.set(selectedIndex, pattern);
myPatternsModel.fireTableRowsUpdated(selectedIndex, selectedIndex);
myPatternsTable.getSelectionModel().setSelectionInterval(selectedIndex, selectedIndex);
// Update model with patterns
for (int i = 0; i < myFilters.size(); i++) {
TodoFilter filter = myFilters.get(i);
if (filter.contains(sourcePattern)) {
filter.removeTodoPattern(sourcePattern);
filter.addTodoPattern(pattern);
myFiltersModel.fireTableRowsUpdated(i, i);
}
}
}
示例10: addNarrowDownCheckbox
import com.intellij.ide.IdeBundle; //导入依赖的package包/类
private void addNarrowDownCheckbox(final JPanel panel) {
final JCheckBox checkBox = new JCheckBox(IdeBundle.message("checkbox.narrow.down.the.list.on.typing"));
checkBox.setSelected(PropertiesComponent.getInstance().isTrueValue(ourPropertyKey));
checkBox.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
myShouldNarrowDown = checkBox.isSelected();
PropertiesComponent.getInstance().setValue(ourPropertyKey, myShouldNarrowDown);
ProjectListBuilder builder = (ProjectListBuilder)myCommanderPanel.getBuilder();
if (builder == null) {
return;
}
builder.addUpdateRequest();
}
});
checkBox.setFocusable(false);
panel.add(checkBox);
//,new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 5), 0, 0));
}
示例11: deleteElement
import com.intellij.ide.IdeBundle; //导入依赖的package包/类
@Override
public void deleteElement(@NotNull DataContext dataContext) {
List<PsiDirectory> allElements = Arrays.asList(getSelectedDirectories());
List<PsiElement> validElements = new ArrayList<PsiElement>();
for (PsiElement psiElement : allElements) {
if (psiElement != null && psiElement.isValid()) validElements.add(psiElement);
}
final PsiElement[] elements = PsiUtilCore.toPsiElementArray(validElements);
LocalHistoryAction a = LocalHistory.getInstance().startAction(IdeBundle.message("progress.deleting"));
try {
DeleteHandler.deletePsiElement(elements, myProject);
}
finally {
a.finish();
}
}
示例12: SuperMethodWarningDialog
import com.intellij.ide.IdeBundle; //导入依赖的package包/类
SuperMethodWarningDialog(@NotNull Project project,
@NotNull String name,
@NotNull String actionString,
boolean isSuperAbstract,
boolean isParentInterface,
boolean isContainedInInterface,
@NotNull String... classNames) {
super(project, true);
myName = name;
myClassNames = classNames;
myActionString = actionString;
myIsSuperAbstract = isSuperAbstract;
myIsParentInterface = isParentInterface;
myIsContainedInInterface = isContainedInInterface;
setTitle(IdeBundle.message("title.warning"));
setButtonsAlignment(SwingConstants.CENTER);
setOKButtonText(CommonBundle.getYesButtonText());
init();
}
示例13: runSingleTask
import com.intellij.ide.IdeBundle; //导入依赖的package包/类
private static void runSingleTask(final DumbModeTask task, final ProgressIndicatorEx taskIndicator) {
if (ApplicationManager.getApplication().isInternal()) LOG.info("Running dumb mode task: " + task);
// nested runProcess is needed for taskIndicator to be honored in ProgressManager.checkCanceled calls deep inside tasks
ProgressManager.getInstance().runProcess(new Runnable() {
@Override
public void run() {
try {
taskIndicator.checkCanceled();
taskIndicator.setIndeterminate(true);
taskIndicator.setText(IdeBundle.message("progress.indexing.scanning"));
task.performInDumbMode(taskIndicator);
}
catch (ProcessCanceledException ignored) {
}
catch (Throwable unexpected) {
LOG.error(unexpected);
}
}
}, taskIndicator);
}
示例14: createProgressPanel
import com.intellij.ide.IdeBundle; //导入依赖的package包/类
private JPanel createProgressPanel() {
final JPanel progressPanel = new JPanel(new GridBagLayout());
myTitleLabel = new JLabel();
myTitleLabel.setFont(UIUtil.getLabelFont().deriveFont(Font.BOLD));
progressPanel.add(myTitleLabel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 2, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(8, 10, 5, 10), 0, 0));
myProgressLabel = new JLabel();
progressPanel.add(myProgressLabel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(8, 10, 0, 10), 0, 0));
myProgressLabel2 = new JLabel() {
@Override
public void setText(String text) {
super.setText(StringUtil.trimMiddle(text, 80));
}
};
progressPanel.add(myProgressLabel2, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(8, 10, 0, 10), 0, 0));
JButton stopButton = new JButton(IdeBundle.message("button.stop.searching"));
stopButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
cancelSearch();
}
});
progressPanel.add(stopButton, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 2, 0.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(10, 0, 0, 10), 0, 0));
return progressPanel;
}
示例15: setShowInternalMessage
import com.intellij.ide.IdeBundle; //导入依赖的package包/类
public void setShowInternalMessage(String message) {
myTopPanel.removeAll();
if (message == null) {
myTopPanel.add(new JLabel(IdeBundle.message("label.name")),
new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE,
new Insets(0, 0, 0, 2), 0, 0));
myTopPanel.add(myNameField,
new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER,
GridBagConstraints.HORIZONTAL, new Insets(3, 2, 3, 2), 0, 0));
myTopPanel.add(new JLabel(IdeBundle.message("label.extension")),
new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE,
new Insets(0, 2, 0, 2), 0, 0));
myTopPanel.add(myExtensionField,
new GridBagConstraints(3, 0, 1, 1, .3, 0.0, GridBagConstraints.CENTER,
GridBagConstraints.HORIZONTAL, new Insets(0, 2, 0, 0), 0, 0));
myExtensionField.setColumns(7);
}
myMainPanel.revalidate();
myTopPanel.repaint();
}