本文整理匯總了Java中com.intellij.CommonBundle類的典型用法代碼示例。如果您正苦於以下問題:Java CommonBundle類的具體用法?Java CommonBundle怎麽用?Java CommonBundle使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
CommonBundle類屬於com.intellij包,在下文中一共展示了CommonBundle類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: CannotUndoReportDialog
import com.intellij.CommonBundle; //導入依賴的package包/類
public CannotUndoReportDialog(Project project, @Nls String problemText, Collection<DocumentReference> files) {
super(project, false);
DefaultListModel model = new DefaultListModel();
for (DocumentReference file : files) {
final VirtualFile vFile = file.getFile();
if (vFile != null) {
model.add(0, vFile.getPresentableUrl());
}
else {
model.add(0, "<unknown file>");
}
}
myProblemFilesList.setModel(model);
setTitle(CommonBundle.message("cannot.undo.dialog.title"));
myProblemMessageLabel.setText(problemText);
myProblemMessageLabel.setIcon(Messages.getErrorIcon());
init();
}
示例2: clearReadOnlyFlag
import com.intellij.CommonBundle; //導入依賴的package包/類
private static boolean clearReadOnlyFlag(final VirtualFile virtualFile, final Project project) {
final boolean[] success = new boolean[1];
CommandProcessor.getInstance().executeCommand(project, new Runnable() {
@Override
public void run() {
Runnable action = new Runnable() {
@Override
public void run() {
try {
ReadOnlyAttributeUtil.setReadOnlyAttribute(virtualFile, false);
success[0] = true;
}
catch (IOException e1) {
Messages.showMessageDialog(project, e1.getMessage(), CommonBundle.getErrorTitle(), Messages.getErrorIcon());
}
}
};
ApplicationManager.getApplication().runWriteAction(action);
}
}, "", null);
return success[0];
}
示例3: ContentChooser
import com.intellij.CommonBundle; //導入依賴的package包/類
public ContentChooser(Project project, String title, boolean useIdeaEditor, boolean allowMultipleSelections) {
super(project, true);
myProject = project;
myUseIdeaEditor = useIdeaEditor;
myAllowMultipleSelections = allowMultipleSelections;
myUpdateAlarm = new Alarm(getDisposable());
mySplitter = new JBSplitter(true, 0.3f);
mySplitter.setSplitterProportionKey(getDimensionServiceKey() + ".splitter");
myList = new JBList(new CollectionListModel<Item>());
myList.setExpandableItemsEnabled(false);
setOKButtonText(CommonBundle.getOkButtonText());
setTitle(title);
init();
}
示例4: doOKAction
import com.intellij.CommonBundle; //導入依賴的package包/類
@Override
protected void doOKAction() {
if (getSchemeName().trim().isEmpty()) {
Messages.showMessageDialog(getContentPane(), ApplicationBundle.message("error.scheme.must.have.a.name"),
CommonBundle.getErrorTitle(), Messages.getErrorIcon());
return;
}
else if ("default".equals(getSchemeName())) {
Messages.showMessageDialog(getContentPane(), ApplicationBundle.message("error.illegal.scheme.name"),
CommonBundle.getErrorTitle(), Messages.getErrorIcon());
return;
}
else if (myExistingNames.contains(getSchemeName())) {
Messages.showMessageDialog(
getContentPane(),
ApplicationBundle.message("error.a.scheme.with.this.name.already.exists.or.was.deleted.without.applying.the.changes"),
CommonBundle.getErrorTitle(),
Messages.getErrorIcon()
);
return;
}
super.doOKAction();
}
示例5: doOKAction
import com.intellij.CommonBundle; //導入依賴的package包/類
protected void doOKAction() {
if (myAddSupportPanel.hasSelectedFrameworks()) {
if (!myAddSupportPanel.downloadLibraries()) {
int answer = Messages.showYesNoDialog(myAddSupportPanel.getMainPanel(),
ProjectBundle.message("warning.message.some.required.libraries.wasn.t.downloaded"),
CommonBundle.getWarningTitle(), Messages.getWarningIcon());
if (answer != Messages.YES) {
return;
}
}
DumbService.allowStartingDumbModeInside(DumbModePermission.MAY_START_BACKGROUND, new Runnable() {
@Override
public void run() {
new WriteAction() {
protected void run(@NotNull final Result result) {
ModifiableRootModel model = ModuleRootManager.getInstance(myModule).getModifiableModel();
myAddSupportPanel.addSupport(myModule, model);
model.commit();
}
}.execute();
}
});
}
super.doOKAction();
}
示例6: actionPerformed
import com.intellij.CommonBundle; //導入依賴的package包/類
@Override
public void actionPerformed(ActionEvent e) {
final PluginManagerConfigurable configurable = createAvailableConfigurable(myVendor);
final SingleConfigurableEditor configurableEditor =
new SingleConfigurableEditor(myActionsPanel, configurable, ShowSettingsUtilImpl.createDimensionKey(configurable), false) {
{
setOKButtonText(CommonBundle.message("close.action.name"));
setOKButtonMnemonic('C');
final String filter = myFilter.getFilter();
if (!StringUtil.isEmptyOrSpaces(filter)) {
final Runnable searchRunnable = configurable.enableSearch(filter);
LOG.assertTrue(searchRunnable != null);
searchRunnable.run();
}
}
@NotNull
@Override
protected Action[] createActions() {
return new Action[]{getOKAction()};
}
};
configurableEditor.show();
}
示例7: processFoundCodeSmells
import com.intellij.CommonBundle; //導入依賴的package包/類
private ReturnResult processFoundCodeSmells(final List<CodeSmellInfo> codeSmells, @Nullable CommitExecutor executor) {
int errorCount = collectErrors(codeSmells);
int warningCount = codeSmells.size() - errorCount;
String commitButtonText = executor != null ? executor.getActionText() : myCheckinPanel.getCommitActionName();
if (commitButtonText.endsWith("...")) {
commitButtonText = commitButtonText.substring(0, commitButtonText.length()-3);
}
final int answer = Messages.showYesNoCancelDialog(myProject,
VcsBundle.message("before.commit.files.contain.code.smells.edit.them.confirm.text", errorCount, warningCount),
VcsBundle.message("code.smells.error.messages.tab.name"), VcsBundle.message("code.smells.review.button"),
commitButtonText, CommonBundle.getCancelButtonText(), UIUtil.getWarningIcon());
if (answer == Messages.YES) {
CodeSmellDetector.getInstance(myProject).showCodeSmellErrors(codeSmells);
return ReturnResult.CLOSE_WINDOW;
}
else if (answer == Messages.CANCEL) {
return ReturnResult.CANCEL;
}
else {
return ReturnResult.COMMIT;
}
}
示例8: actionPerformed
import com.intellij.CommonBundle; //導入依賴的package包/類
@Override
public void actionPerformed(AnActionEvent e) {
new Thread("show delayed msg") {
@Override
public void run() {
super.run();
//noinspection EmptyCatchBlock
TimeoutUtil.sleep(3000);
//noinspection SSBasedInspection
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
MessageDialogBuilder.yesNo("Nothing happens after that", "Some message goes here").yesText(
ApplicationBundle.message("command.exit")).noText(
CommonBundle.message("button.cancel")).show();
}
});
}
}.start();
}
示例9: removeCoverageSuite
import com.intellij.CommonBundle; //導入依賴的package包/類
public void removeCoverageSuite(final CoverageSuite suite) {
final String fileName = suite.getCoverageDataFileName();
boolean deleteTraces = suite.isTracingEnabled();
if (!FileUtil.isAncestor(PathManager.getSystemPath(), fileName, false)) {
String message = "Would you like to delete file \'" + fileName + "\' ";
if (deleteTraces) {
message += "and traces directory \'" + FileUtil.getNameWithoutExtension(new File(fileName)) + "\' ";
}
message += "on disk?";
if (Messages.showYesNoDialog(myProject, message, CommonBundle.getWarningTitle(), Messages.getWarningIcon()) == Messages.YES) {
deleteCachedCoverage(fileName, deleteTraces);
}
} else {
deleteCachedCoverage(fileName, deleteTraces);
}
myCoverageSuites.remove(suite);
if (myCurrentSuitesBundle != null && myCurrentSuitesBundle.contains(suite)) {
CoverageSuite[] suites = myCurrentSuitesBundle.getSuites();
suites = ArrayUtil.remove(suites, suite);
chooseSuitesBundle(suites.length > 0 ? new CoverageSuitesBundle(suites) : null);
}
}
示例10: EditVariableDialog
import com.intellij.CommonBundle; //導入依賴的package包/類
public EditVariableDialog(Editor editor, Component parent, ArrayList<Variable> variables, List<TemplateContextType> contextTypes) {
super(parent, true);
myContextTypes = contextTypes;
setButtonsMargin(null);
myVariables = variables;
myEditor = editor;
init();
setTitle(CodeInsightBundle.message("templates.dialog.edit.variables.title"));
setOKButtonText(CommonBundle.getOkButtonText());
}
示例11: messageOrNull
import com.intellij.CommonBundle; //導入依賴的package包/類
@Nullable
public static String messageOrNull(@NotNull ResourceBundle bundle, @NotNull String key,
@NotNull Object... params) {
final String value = CommonBundle.messageOrDefault(bundle, key, key, params);
if (key.equals(value)) return null;
return value;
}
示例12: applyFix
import com.intellij.CommonBundle; //導入依賴的package包/類
@Override
public void applyFix(@NotNull Project project, PsiFile file, @Nullable Editor editor) {
InspectionProjectProfileManager profileManager = InspectionProjectProfileManager.getInstance(project);
InspectionProfile inspectionProfile = profileManager.getInspectionProfile();
ModifiableModel model = inspectionProfile.getModifiableModel();
model.disableTool(myToolId, file);
try {
model.commit();
}
catch (IOException e) {
Messages.showErrorDialog(project, e.getMessage(), CommonBundle.getErrorTitle());
}
DaemonCodeAnalyzer.getInstance(project).restart();
}
示例13: doOKAction
import com.intellij.CommonBundle; //導入依賴的package包/類
@Override
protected void doOKAction() {
final String keywordName = myKeywordName.getText().trim();
if (keywordName.length() == 0) {
Messages.showMessageDialog(getContentPane(), IdeBundle.message("error.keyword.cannot.be.empty"),
CommonBundle.getErrorTitle(), Messages.getErrorIcon());
return;
}
if (keywordName.indexOf(' ') >= 0) {
Messages.showMessageDialog(getContentPane(), IdeBundle.message("error.keyword.may.not.contain.spaces"),
CommonBundle.getErrorTitle(), Messages.getErrorIcon());
return;
}
super.doOKAction();
}
示例14: showResults
import com.intellij.CommonBundle; //導入依賴的package包/類
private ReturnResult showResults(final TodoCheckinHandlerWorker worker, CommitExecutor executor) {
String commitButtonText = executor != null ? executor.getActionText() : myCheckinProjectPanel.getCommitActionName();
if (commitButtonText.endsWith("...")) {
commitButtonText = commitButtonText.substring(0, commitButtonText.length()-3);
}
final String text = createMessage(worker);
final String[] buttons;
final boolean thereAreTodoFound = worker.getAddedOrEditedTodos().size() + worker.getInChangedTodos().size() > 0;
int commitOption;
if (thereAreTodoFound) {
buttons = new String[]{VcsBundle.message("todo.in.new.review.button"), commitButtonText, CommonBundle.getCancelButtonText()};
commitOption = 1;
}
else {
buttons = new String[]{commitButtonText, CommonBundle.getCancelButtonText()};
commitOption = 0;
}
final int answer = Messages.showDialog(myProject, text, "TODO", null, buttons, 0, 1, UIUtil.getWarningIcon());
if (thereAreTodoFound && answer == Messages.OK) {
showTodo(worker);
return ReturnResult.CLOSE_WINDOW;
}
if (answer == commitOption) {
return ReturnResult.COMMIT;
}
return ReturnResult.CANCEL;
}
示例15: ConfirmationDialog
import com.intellij.CommonBundle; //導入依賴的package包/類
public ConfirmationDialog(Project project, final String message, String title, final Icon icon, final VcsShowConfirmationOption option,
@Nullable String okActionName, @Nullable String cancelActionName) {
super(project, message, title, icon);
myOption = option;
myOkActionName = okActionName != null ? okActionName : CommonBundle.getYesButtonText();
myCancelActionName = cancelActionName != null ? cancelActionName : CommonBundle.getNoButtonText();
init();
}