Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.netbeans.modules.groovy.grailsproject.plugins.GrailsPlugin;
import org.netbeans.modules.groovy.grailsproject.plugins.GrailsPluginSupport;
import org.openide.util.NbBundle;
import org.openide.util.Utilities;

/**
* @author David Calavera
Expand Down Expand Up @@ -462,7 +463,7 @@ public String getDescription() {
chooser.setDialogTitle(NbBundle.getMessage(GrailsPluginsPanel.class, "TITLE_BrowsePluginLocation"));
chooser.setApproveButtonText(NbBundle.getMessage(GrailsPluginsPanel.class, "LBL_BrowsePluginLocation_OK_Button"));

if (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
if (chooser.showOpenDialog(Utilities.findDialogParent()) == JFileChooser.APPROVE_OPTION) {
pluginZipPath.setText(chooser.getSelectedFile().getAbsolutePath());
installButton.setEnabled(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import org.openide.util.Exceptions;
import org.openide.util.HelpCtx;
import org.openide.util.NbBundle;
import org.openide.util.Utilities;

/**
*
Expand Down Expand Up @@ -137,7 +138,7 @@ public String getName() {
try {
name = navCase.getFromOutcome() != null ? navCase.getFromOutcome() : navCase.getFromAction();
} catch (IllegalStateException ise){
JOptionPane.showMessageDialog(null, MSG_FacesConfigIllegalStateWarning, TLE_FacesConfigIllegalStateWarning, JOptionPane.WARNING_MESSAGE);
JOptionPane.showMessageDialog(Utilities.findDialogParent(), MSG_FacesConfigIllegalStateWarning, TLE_FacesConfigIllegalStateWarning, JOptionPane.WARNING_MESSAGE);
}
}
return name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ private void copy() {
int[] colsselected = insertRecordTableUI.getSelectedColumns();
if (!((numrows - 1 == rowsselected[rowsselected.length - 1] - rowsselected[0] && numrows == rowsselected.length) &&
(numcols - 1 == colsselected[colsselected.length - 1] - colsselected[0] && numcols == colsselected.length))) {
JOptionPane.showMessageDialog(null, "Invalid Copy Selection", "Invalid Copy Selection", JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(Utilities.findDialogParent(), "Invalid Copy Selection", "Invalid Copy Selection", JOptionPane.ERROR_MESSAGE);
return;
}
for (int i = 0; i < numrows; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.netbeans.api.progress.BaseProgressUtils;
import org.netbeans.modules.db.dataview.output.DataViewTableUIModel;
import org.openide.util.NbBundle;
import org.openide.util.Utilities;

/**
*
Expand Down Expand Up @@ -76,8 +77,7 @@ public static synchronized void extractAsFile(final DataViewTableUIModel model)

private static boolean checkFile(File file) {
if (file.exists()) {
int a = JOptionPane.showConfirmDialog(
null,
int a = JOptionPane.showConfirmDialog(Utilities.findDialogParent(),
Bundle.LBL_OVEWRITE_DIALOG(),
Bundle.MSG_OVEWRITE_DIALOG(),
JOptionPane.YES_NO_OPTION);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
import org.openide.util.Mutex;
import org.openide.util.NbBundle;
import org.openide.util.RequestProcessor.Task;
import org.openide.util.Utilities;

/**
*
Expand Down Expand Up @@ -271,7 +272,7 @@ private void initSubmodules () {
}

private boolean confirmSubmoduleInit (List<File> subrepos) {
return JOptionPane.YES_OPTION == JOptionPane.showConfirmDialog(null,
return JOptionPane.YES_OPTION == JOptionPane.showConfirmDialog(Utilities.findDialogParent(),
Bundle.MSG_Clone_confirmSubmoduleInit_text(),
Bundle.LBL_Clone_confirmSubmoduleInit_title(),
JOptionPane.YES_NO_OPTION,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ public boolean cancel() {

OutputLogger logger = support.getLogger();
logger.outputInRed(NbBundle.getMessage(CloneAction.class, "MSG_CLONE_CANCEL_ATTEMPT")); // NOI18N
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(Utilities.findDialogParent(),
NbBundle.getMessage(CloneAction.class, "MSG_CLONE_CANCEL_NOT_SUPPORTED"),// NOI18N
NbBundle.getMessage(CloneAction.class, "MSG_CLONE_CANCEL_NOT_SUPPORTED_TITLE"),// NOI18N
JOptionPane.INFORMATION_MESSAGE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
import org.openide.cookies.SaveCookie;
import org.openide.filesystems.FileUtil;
import org.openide.nodes.Node;
import org.openide.util.Utilities;

/**
* Commit action for mercurial:
Expand Down Expand Up @@ -148,7 +149,7 @@ protected void performContextAction(Node[] nodes) {
NbBundle.getMessage(CommitAction.class, "MSG_COMMIT_NOT_SUPPORTED_INVIEW_INFO")); // NOI18N
logger.output(""); // NOI18N
logger.closeLog();
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(Utilities.findDialogParent(),
NbBundle.getMessage(CommitAction.class, "MSG_COMMIT_NOT_SUPPORTED_INVIEW"),// NOI18N
NbBundle.getMessage(CommitAction.class, "MSG_COMMIT_NOT_SUPPORTED_INVIEW_TITLE"),// NOI18N
JOptionPane.INFORMATION_MESSAGE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.netbeans.modules.mercurial.ui.log.HgLogMessage.HgRevision;
import org.openide.nodes.Node;
import org.openide.util.NbBundle;
import org.openide.util.Utilities;
import static org.netbeans.modules.mercurial.ui.diff.Bundle.*;

/**
Expand Down Expand Up @@ -89,7 +90,7 @@ protected void performContextAction(Node[] nodes) {
NbBundle.getMessage(DiffAction.class, "MSG_DIFF_NOT_SUPPORTED_INVIEW_INFO")); // NOI18N
logger.output(""); // NOI18N
logger.closeLog();
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(Utilities.findDialogParent(),
NbBundle.getMessage(DiffAction.class, "MSG_DIFF_NOT_SUPPORTED_INVIEW"),// NOI18N
NbBundle.getMessage(DiffAction.class, "MSG_DIFF_NOT_SUPPORTED_INVIEW_TITLE"),// NOI18N
JOptionPane.INFORMATION_MESSAGE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import org.netbeans.modules.mercurial.ui.log.HgLogMessage;
import org.openide.DialogDescriptor;
import org.openide.nodes.Node;
import org.openide.util.Utilities;

/**
* Merge action for mercurial:
Expand Down Expand Up @@ -84,7 +85,7 @@ protected void performContextAction(Node[] nodes) {
NbBundle.getMessage(MergeAction.class, "MSG_MERGE_NOT_SUPPORTED_INVIEW_INFO")); // NOI18N
logger.output(""); // NOI18N
logger.closeLog();
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(Utilities.findDialogParent(),
NbBundle.getMessage(MergeAction.class, "MSG_MERGE_NOT_SUPPORTED_INVIEW"),// NOI18N
NbBundle.getMessage(MergeAction.class, "MSG_MERGE_NOT_SUPPORTED_INVIEW_TITLE"),// NOI18N
JOptionPane.INFORMATION_MESSAGE);
Expand All @@ -103,7 +104,7 @@ public void perform() {
logger.output( NbBundle.getMessage(MergeAction.class,"MSG_NOTHING_TO_MERGE")); // NOI18N
logger.outputInRed( NbBundle.getMessage(MergeAction.class, "MSG_MERGE_DONE")); // NOI18N
logger.output(""); // NOI18N
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(Utilities.findDialogParent(),
NbBundle.getMessage(MergeAction.class,"MSG_NOTHING_TO_MERGE"),// NOI18N
NbBundle.getMessage(MergeAction.class,"MSG_MERGE_TITLE"),// NOI18N
JOptionPane.INFORMATION_MESSAGE);
Expand Down Expand Up @@ -163,7 +164,7 @@ public static boolean handleMergeOutput(File root, List<String> listMerge, Outpu
if (interactive) {
logger.outputInRed(NbBundle.getMessage(MergeAction.class,
"MSG_MERGE_FAILED")); // NOI18N
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(Utilities.findDialogParent(),
NbBundle.getMessage(MergeAction.class, "MSG_MERGE_UNCOMMITTED"), // NOI18N
NbBundle.getMessage(MergeAction.class, "MSG_MERGE_TITLE"), // NOI18N
JOptionPane.WARNING_MESSAGE);
Expand Down Expand Up @@ -202,7 +203,7 @@ public static boolean handleMergeOutput(File root, List<String> listMerge, Outpu
if (HgCommand.isMergeUnavailableMsg(line)) {
bMergeFailed = true;
if (interactive) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(Utilities.findDialogParent(),
NbBundle.getMessage(MergeAction.class, "MSG_MERGE_UNAVAILABLE"), // NOI18N
NbBundle.getMessage(MergeAction.class, "MSG_MERGE_TITLE"), // NOI18N
JOptionPane.WARNING_MESSAGE);
Expand Down Expand Up @@ -252,7 +253,7 @@ public static void displayMergeWarning (Map<String, Collection<HgLogMessage>> br
return;
}
Action a = logger.getOpenOutputAction();
if (warnInDialog && a != null && JOptionPane.showConfirmDialog(null, NbBundle.getMessage(MergeAction.class, "MSG_MERGE_NEEDED_BRANCHES"), //NOI18N
if (warnInDialog && a != null && JOptionPane.showConfirmDialog(Utilities.findDialogParent(), NbBundle.getMessage(MergeAction.class, "MSG_MERGE_NEEDED_BRANCHES"), //NOI18N
NbBundle.getMessage(MergeAction.class, "TITLE_MERGE_NEEDED_BRANCHES"), //NOI18N
JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION) {
a.actionPerformed(new ActionEvent(MergeAction.class, ActionEvent.ACTION_PERFORMED, null));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.netbeans.modules.mercurial.util.HgRepositoryContextCache;
import org.openide.util.NbBundle;
import org.openide.util.RequestProcessor;
import org.openide.util.Utilities;

/**
*
Expand Down Expand Up @@ -127,7 +128,7 @@ protected void perform() {
if (bPropChanged && hgPropertyValue.trim().length() >= 0) {
if (hgPropertyName.equals(HGPROPNAME_USERNAME) &&
!HgModuleConfig.getDefault().isUserNameValid(hgPropertyValue)) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(Utilities.findDialogParent(),
NbBundle.getMessage(HgProperties.class, "MSG_WARN_USER_NAME_TEXT"), // NOI18N
NbBundle.getMessage(HgProperties.class, "MSG_WARN_FIELD_TITLE"), // NOI18N
JOptionPane.WARNING_MESSAGE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
import org.openide.filesystems.FileUtil;
import org.openide.nodes.AbstractNode;
import org.openide.nodes.Children;
import org.openide.util.Utilities;
import org.openide.util.actions.SystemAction;
import org.openide.util.lookup.Lookups;

Expand Down Expand Up @@ -193,7 +194,7 @@ public static boolean confirmWithLocalChanges(File rootFile, Class bundleLocatio
if (listIncomingAndLocalMod.size() > 0) {
logger.outputInRed(NbBundle.getMessage(PullAction.class, "MSG_PULL_OVERWRITE_LOCAL")); // NOI18N
logger.output(listIncomingAndLocalMod);
int response = JOptionPane.showOptionDialog(null,
int response = JOptionPane.showOptionDialog(Utilities.findDialogParent(),
NbBundle.getMessage(bundleLocation, query), NbBundle.getMessage(bundleLocation, title),
JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null);

Expand Down Expand Up @@ -392,7 +393,7 @@ private static Boolean confirmOverallModifications (File root, HgProgressSupport
for (Map.Entry<File, FileInformation> e : statuses.entrySet()) {
FileInformation info = e.getValue();
if ((info.getStatus() & interestingStatus) != 0) {
confirmed = JOptionPane.YES_OPTION == JOptionPane.showConfirmDialog(null,
confirmed = JOptionPane.YES_OPTION == JOptionPane.showConfirmDialog(Utilities.findDialogParent(),
Bundle.MSG_PullAction_localModifications_text(),
Bundle.LBL_PullAction_localModifications_title(),
JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
import org.openide.awt.ActionID;
import org.openide.awt.ActionRegistration;
import org.openide.filesystems.FileUtil;
import org.openide.util.Utilities;

/**
* Push action for mercurial:
Expand Down Expand Up @@ -281,7 +282,7 @@ static void performPush(File root, HgURL pushUrl, String fromPrjName,
logger, showSaveCredsOption);
String newBranches = failedNewBranch(list);
if (newBranches != null) {
if (JOptionPane.YES_OPTION == JOptionPane.showConfirmDialog(null,
if (JOptionPane.YES_OPTION == JOptionPane.showConfirmDialog(Utilities.findDialogParent(),
Bundle.MSG_PushAction_questionPushNewBranches(newBranches),
NbBundle.getMessage(PushAction.class, "MSG_PUSH_ERROR_TITLE"), //NOI18N
JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.netbeans.modules.mercurial.util.HgUtils;
import org.netbeans.modules.versioning.util.Utils;
import org.openide.util.NbBundle;
import org.openide.util.Utilities;

/**
*
Expand Down Expand Up @@ -92,7 +93,7 @@ private void addToRejects (String patchedFilePath, String rejectedFilePath) {
void resolveFailure () {
if (isFailure()) {
HgUtils.openOutput(logger);
if (JOptionPane.showConfirmDialog(null, NbBundle.getMessage(FailedPatchResolver.class, "MSG_FailedPatchResolver_patchApplyFailed", failedPatch), //NOI18N
if (JOptionPane.showConfirmDialog(Utilities.findDialogParent(), NbBundle.getMessage(FailedPatchResolver.class, "MSG_FailedPatchResolver_patchApplyFailed", failedPatch), //NOI18N
NbBundle.getMessage(FailedPatchResolver.class, "LBL_FailedPatchResolver_patchApplyFailed"), //NOI18N
JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION) {
for (Map.Entry<File, File> e : rejects.entrySet()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import org.openide.DialogDisplayer;
import org.openide.NotifyDescriptor;
import org.openide.nodes.Node;
import org.openide.util.Utilities;

/**
* Pull action for mercurial:
Expand Down Expand Up @@ -122,7 +123,7 @@ public void perform() {
Mercurial.getInstance().historyChanged(root);
Mercurial.getInstance().changesetChanged(root);
} else {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(Utilities.findDialogParent(),
NbBundle.getMessage(RollbackAction.class,"MSG_ROLLBACK_MESSAGE_NOHISTORY") , // NOI18N
NbBundle.getMessage(RollbackAction.class,"MSG_ROLLBACK_MESSAGE"), // NOI18N
JOptionPane.INFORMATION_MESSAGE,null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ public static String findInUserPath(String... names) {
* @return boolean true - answered Yes, false - answered No
*/
public static boolean confirmDialog(Class bundleLocation, String title, String query) {
int response = JOptionPane.showOptionDialog(null, NbBundle.getMessage(bundleLocation, query), NbBundle.getMessage(bundleLocation, title), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null);
int response = JOptionPane.showOptionDialog(Utilities.findDialogParent(), NbBundle.getMessage(bundleLocation, query), NbBundle.getMessage(bundleLocation, title), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null);

if (response == JOptionPane.YES_OPTION) {
return true;
Expand All @@ -276,7 +276,7 @@ public static boolean confirmDialog(Class bundleLocation, String title, String q
* @param warning to display to the user
*/
public static void warningDialog(Class bundleLocation, String title, String warning) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(Utilities.findDialogParent(),
NbBundle.getMessage(bundleLocation,warning),
NbBundle.getMessage(bundleLocation,title),
JOptionPane.WARNING_MESSAGE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
import org.openide.util.NbBundle;
import org.openide.util.NbCollections;
import org.openide.util.RequestProcessor;
import org.openide.util.Utilities;
import org.openide.util.WeakListeners;
import org.openide.util.lookup.ServiceProvider;
import org.openide.xml.XMLUtil;
Expand Down Expand Up @@ -191,7 +192,7 @@ public String getDescription() {
};
jfc.setFileFilter(filter);
FileUtil.preventFileChooserSymlinkTraversal(jfc, null); // XXX remember last-selected dir
while (jfc.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
while (jfc.showOpenDialog(Utilities.findDialogParent()) == JFileChooser.APPROVE_OPTION) {
File f = jfc.getSelectedFile();
if (filter.accept(f)) {
return new ProjectLibraryArea(f);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {

private void bBrowseActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bBrowseActionPerformed
JFileChooser filechooser = new JFileChooser (tDictionary.getText ());
int ret = filechooser.showOpenDialog (null);
int ret = filechooser.showOpenDialog (org.openide.util.Utilities.findDialogParent());
if (ret == JFileChooser.APPROVE_OPTION)
tDictionary.setText (filechooser.getSelectedFile ().getAbsolutePath ());
}//GEN-LAST:event_bBrowseActionPerformed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import java.io.ByteArrayInputStream;
import java.util.logging.Level;
import org.openide.filesystems.FileUtil;
import org.openide.util.Utilities;

/**
* Handles module events distributed by NetBeans module
Expand Down Expand Up @@ -93,7 +94,7 @@ public void run() {
}
}
if (!notified) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(Utilities.findDialogParent(),
NbBundle.getBundle(ModuleLifecycleManager.class).getString("MSG_Install_Warning"), // NOI18N
NbBundle.getBundle(ModuleLifecycleManager.class).getString("MSG_Install_Warning_Title"), // NOI18N
JOptionPane.WARNING_MESSAGE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public void run() {
});
} catch (IOException ioex) {
if (NESTED_CONFLICT.equals(ioex.getMessage())) {
JOptionPane.showMessageDialog(null, NbBundle.getMessage(ResolveConflictsExecutor.class, "MSG_NestedConflicts"),
JOptionPane.showMessageDialog(Utilities.findDialogParent(), NbBundle.getMessage(ResolveConflictsExecutor.class, "MSG_NestedConflicts"),
NbBundle.getMessage(ResolveConflictsExecutor.class, "MSG_NestedConflicts_Title"),
JOptionPane.WARNING_MESSAGE);
Utils.openFile(file);
Expand Down
Loading