use of com.haulmont.cuba.desktop.sys.DialogWindow in project cuba by cuba-platform.
the class DesktopWindow method setCaption.
@Override
public void setCaption(String caption) {
this.caption = caption;
DialogWindow dialogWindow = asDialogWindow();
if (dialogWindow != null) {
dialogWindow.setTitle(caption);
} else {
JPanel tabWindow = asTabWindow();
if (tabWindow != null) {
setTabCaptionAndDescription(tabWindow);
} else {
JPanel singleWindow = asDetachedWindow();
if (singleWindow != null) {
TopLevelFrame topLevelFrame = asTopLevelFrame();
if (topLevelFrame != null) {
topLevelFrame.setTitle(formatTabCaption(caption, description));
}
windowManager.getBreadCrumbs(singleWindow).update();
}
}
}
}
use of com.haulmont.cuba.desktop.sys.DialogWindow in project cuba by cuba-platform.
the class DesktopWindow method setDescription.
@Override
public void setDescription(String description) {
this.description = description;
DialogWindow dialogWindow = asDialogWindow();
if (dialogWindow != null) {
dialogWindow.setTitle(caption);
} else {
JPanel tabWindow = asTabWindow();
if (tabWindow != null) {
setTabCaptionAndDescription(tabWindow);
} else {
JPanel singleWindow = asDetachedWindow();
if (singleWindow != null) {
TopLevelFrame topLevelFrame = asTopLevelFrame();
if (topLevelFrame != null) {
topLevelFrame.setTitle(formatTabCaption(caption, description));
}
}
}
}
}
use of com.haulmont.cuba.desktop.sys.DialogWindow in project cuba by cuba-platform.
the class DesktopWindow method requestRepaint.
protected void requestRepaint() {
if (!scheduledRepaint) {
SwingUtilities.invokeLater(() -> {
getContainer().revalidate();
getContainer().repaint();
java.awt.Container container = getContainer().getTopLevelAncestor();
if (container instanceof DialogWindow) {
DialogWindow dialog = (DialogWindow) container;
if (!dialog.isResizable() && (getHeight() <= 0 || getWidth() <= 0)) {
dialog.pack();
}
}
scheduledRepaint = false;
});
scheduledRepaint = true;
}
}
use of com.haulmont.cuba.desktop.sys.DialogWindow in project cuba by cuba-platform.
the class DefaultExceptionHandler method handle.
@Override
public boolean handle(Thread thread, Throwable exception) {
JXErrorPane errorPane = new JXErrorPaneExt();
errorPane.setErrorInfo(createErrorInfo(exception));
JDialog dialog = JXErrorPane.createDialog(App.getInstance().getMainFrame(), errorPane);
dialog.setMinimumSize(new Dimension(600, (int) dialog.getMinimumSize().getHeight()));
final DialogWindow lastDialogWindow = getLastDialogWindow();
dialog.addWindowListener(new WindowAdapter() {
@Override
public void windowClosed(WindowEvent e) {
if (lastDialogWindow != null)
lastDialogWindow.enableWindow();
else
App.getInstance().getMainFrame().activate();
}
});
dialog.setModal(false);
if (lastDialogWindow != null)
lastDialogWindow.disableWindow(null);
else
App.getInstance().getMainFrame().deactivate(null);
dialog.setVisible(true);
return true;
}
Aggregations