MacMessageException -> MessageException (exception fix)

This commit is contained in:
Denis Fokin
2014-12-22 21:18:46 +03:00
parent dada824558
commit 1c1d184de1
4 changed files with 14 additions and 9 deletions
@@ -33,6 +33,7 @@ import com.intellij.ui.BrowserHyperlinkListener;
import com.intellij.ui.DocumentAdapter;
import com.intellij.ui.InsertPathAction;
import com.intellij.ui.ScrollPaneFactory;
import com.intellij.ui.MessageException;
import com.intellij.ui.components.JBScrollPane;
import com.intellij.ui.mac.MacMessages;
import com.intellij.ui.mac.foundation.MacUtil;
@@ -485,6 +486,9 @@ public class Messages {
return MacMessages.getInstance().showYesNoDialog(title, message, yesText, noText, null, doNotAskOption);
}
}
catch (MessageException messageException) {
// just show a dialog instead
}
catch (Exception exception) {
LOG.error(exception);
}
@@ -13,13 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.ui.mac;
package com.intellij.ui;
/**
* Created by denis on 28/01/14.
*/
public class MacMessageException extends RuntimeException {
public MacMessageException(final String message) {
public class MessageException extends RuntimeException {
public MessageException(final String message) {
super(message);
}
}
@@ -24,6 +24,7 @@ import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.wm.IdeFocusManager;
import com.intellij.openapi.wm.WindowManager;
import com.intellij.openapi.wm.impl.ModalityHelper;
import com.intellij.ui.MessageException;
import com.intellij.ui.mac.foundation.ID;
import com.intellij.ui.mac.foundation.MacUtil;
import com.intellij.util.ui.UIUtil;
@@ -332,7 +333,7 @@ public class MacMessagesImpl extends MacMessages {
method.invoke(theQueue, event);
}
}
catch (MacMessageException mme) {
catch (MessageException mme) {
throw mme;
}
catch (Throwable e) {
@@ -428,7 +429,7 @@ public class MacMessagesImpl extends MacMessages {
private ID getParamsAsID() {
if (window == null) {
throw new MacMessageException("Window should be in the list.");
throw new MessageException("Window should be in the list.");
}
params.put(COMMON_DIALOG_PARAM_TYPE.nativeFocusedWindow, window);
@@ -598,7 +599,7 @@ public class MacMessagesImpl extends MacMessages {
//}
queuesFromDocumentRoot.remove(documentRoot);
if (blockedDocumentRoots.remove(documentRoot) != null) {
throw new MacMessageException("Owner window has been removed");
throw new MessageException("Owner window has been removed");
}
}
});
@@ -732,7 +733,7 @@ public class MacMessagesImpl extends MacMessages {
if (SystemInfo.isAppleJvm && MacUtil.getWindowTitle(_window) == null) {
// With Apple JDK we cannot find a window if it does not have a title
// Let's show a dialog instead of the message.
throw new MacMessageException("MacMessage parent does not have a title.");
throw new MessageException("MacMessage parent does not have a title.");
}
while (_window != null && MacUtil.getWindowTitle(_window) == null) {
_window = _window.getOwner();
@@ -22,7 +22,7 @@ import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.wm.IdeFocusManager;
import com.intellij.openapi.wm.WindowManager;
import com.intellij.openapi.wm.impl.ModalityHelper;
import com.intellij.ui.mac.MacMessageException;
import com.intellij.ui.MessageException;
import com.intellij.ui.mac.MacMessagesEmulation;
import com.intellij.ui.mac.foundation.MacUtil;
import com.intellij.util.ui.UIUtil;
@@ -149,7 +149,7 @@ public class JBMacMessages extends MacMessagesEmulation {
if (SystemInfo.isAppleJvm && MacUtil.getWindowTitle(_window) == null) {
// With Apple JDK we cannot find a window if it does not have a title
// Let's show a dialog instead of the message.
throw new MacMessageException("MacMessage parent does not have a title.");
throw new MessageException("MacMessage parent does not have a title.");
}
while (_window != null && MacUtil.getWindowTitle(_window) == null) {
_window = _window.getOwner();