Revision: 6193
http://squirrel-sql.svn.sourceforge.net/squirrel-sql/?rev=6193&view=rev
Author: gerdwagner
Date: 2011-03-15 03:26:23 +0000 (Tue, 15 Mar 2011)
Log Message:
-----------
More Query Builder
Modified Paths:
--------------
trunk/sql12/plugins/graph/src/main/java/net/sourceforge/squirrel_sql/plugins/graph/window/GraphWindowController.java
trunk/sql12/plugins/graph/src/main/java/net/sourceforge/squirrel_sql/plugins/graph/window/TabToWindowHandler.java
Modified: trunk/sql12/plugins/graph/src/main/java/net/sourceforge/squirrel_sql/plugins/graph/window/GraphWindowController.java
===================================================================
--- trunk/sql12/plugins/graph/src/main/java/net/sourceforge/squirrel_sql/plugins/graph/window/GraphWindowController.java 2011-03-14 23:30:01 UTC (rev 6192)
+++ trunk/sql12/plugins/graph/src/main/java/net/sourceforge/squirrel_sql/plugins/graph/window/GraphWindowController.java 2011-03-15 03:26:23 UTC (rev 6193)
@@ -161,7 +161,7 @@
onWindowClosing();
}
- private void close()
+ void close()
{
if (null != _dlgWindow)
{
@@ -211,4 +211,16 @@
{
_listener.closing(_tabIdx);
}
+
+ public void rename(String newName)
+ {
+ if(null != _dlgWindow)
+ {
+ _dlgWindow.setTitle(newName);
+ }
+ else
+ {
+ _frameWindow.setTitle(newName);
+ }
+ }
}
Modified: trunk/sql12/plugins/graph/src/main/java/net/sourceforge/squirrel_sql/plugins/graph/window/TabToWindowHandler.java
===================================================================
--- trunk/sql12/plugins/graph/src/main/java/net/sourceforge/squirrel_sql/plugins/graph/window/TabToWindowHandler.java 2011-03-14 23:30:01 UTC (rev 6192)
+++ trunk/sql12/plugins/graph/src/main/java/net/sourceforge/squirrel_sql/plugins/graph/window/TabToWindowHandler.java 2011-03-15 03:26:23 UTC (rev 6193)
@@ -14,6 +14,7 @@
{
private GraphMainPanelTab _graphMainPanelTab;
private ISession _session;
+ private GraphWindowController _graphWindowController;
public TabToWindowHandler(GraphPanelController panelController, ISession session, GraphPlugin plugin)
{
@@ -53,22 +54,23 @@
}
};
- GraphWindowController graphWindowController =
- new GraphWindowController(_session, _graphMainPanelTab, tabIdx, tabBoundsOnScreen, listener);
-
-
+ _graphWindowController = new GraphWindowController(_session, _graphMainPanelTab, tabIdx, tabBoundsOnScreen, listener);
}
private void onWindowClosing(int tabIdx)
{
+ _graphWindowController = null;
+
if(tabIdx <_session.getSessionSheet().getTabCount())
{
_session.getSessionSheet().insertMainTab(_graphMainPanelTab, tabIdx);
}
else
{
- _session.getSessionSheet().addMainTab(_graphMainPanelTab);
+ tabIdx = _session.getSessionSheet().addMainTab(_graphMainPanelTab);
+ _session.getSessionSheet().selectMainTab(tabIdx);
}
+
}
public void showGraph()
@@ -78,14 +80,30 @@
public void removeGraph()
{
- _session.getSessionSheet().removeMainTab(_graphMainPanelTab);
+ if (null == _graphWindowController)
+ {
+ _session.getSessionSheet().removeMainTab(_graphMainPanelTab);
+ }
+ else
+ {
+ _graphWindowController.close();
+ _graphWindowController = null;
+ }
}
public void renameGraph(String newName)
{
- int index = _session.getSessionSheet().removeMainTab(_graphMainPanelTab);
_graphMainPanelTab.setTitle(newName);
- _session.getSessionSheet().insertMainTab(_graphMainPanelTab, index);
+
+ if (null == _graphWindowController)
+ {
+ int index = _session.getSessionSheet().removeMainTab(_graphMainPanelTab);
+ _session.getSessionSheet().insertMainTab(_graphMainPanelTab, index);
+ }
+ else
+ {
+ _graphWindowController.rename(newName);
+ }
}
public String getTitle()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|