Dispose one open second window
This commit is contained in:
parent
c1dc50aeaa
commit
26f9f880b5
2 changed files with 22 additions and 15 deletions
|
@ -74,6 +74,7 @@ public class Document {
|
||||||
readMetadataInDocument();
|
readMetadataInDocument();
|
||||||
frame = xDesktop.getCurrentFrame();
|
frame = xDesktop.getCurrentFrame();
|
||||||
dispatchProvider = UnoRuntime.queryInterface( com.sun.star.frame.XDispatchProvider.class, frame );
|
dispatchProvider = UnoRuntime.queryInterface( com.sun.star.frame.XDispatchProvider.class, frame );
|
||||||
|
hideAnnotations();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
System.out.println("xDesktop inaccessible. Can not proceed.");
|
System.out.println("xDesktop inaccessible. Can not proceed.");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
|
@ -58,7 +58,7 @@ public class EditorGUI extends JFrame {
|
||||||
private DefaultTableModel docCustomPropsModel;
|
private DefaultTableModel docCustomPropsModel;
|
||||||
|
|
||||||
|
|
||||||
//GroupLayouts
|
private static JFrame singleFrame = null;
|
||||||
|
|
||||||
|
|
||||||
private Map<String, String> docProps;
|
private Map<String, String> docProps;
|
||||||
|
@ -80,22 +80,28 @@ public class EditorGUI extends JFrame {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void runGUI(Document doc) {
|
public static void runGUI(Document doc) {
|
||||||
try {
|
if (singleFrame != null) {
|
||||||
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
singleFrame.dispose();
|
||||||
} catch (Throwable e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
EventQueue.invokeLater(new Runnable() {
|
try {
|
||||||
public void run() {
|
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
||||||
try {
|
} catch (Throwable e) {
|
||||||
EditorGUI frame = new EditorGUI(doc);
|
e.printStackTrace();
|
||||||
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
|
|
||||||
frame.setVisible(true);
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
EventQueue.invokeLater(new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
EditorGUI frame = new EditorGUI(doc);
|
||||||
|
singleFrame = frame;
|
||||||
|
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
|
||||||
|
frame.setVisible(true);
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void testGUI() {
|
private static void testGUI() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue