This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 224791 - Patch for: History/source switch in SQL Command view is not useful
Summary: Patch for: History/source switch in SQL Command view is not useful
Status: RESOLVED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.3
Hardware: PC Linux
: P3 normal (vote)
Assignee: Libor Fischmeistr
URL:
Keywords: PATCH_AVAILABLE
: 232807 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-01-12 18:22 UTC by everflux
Modified: 2013-11-22 02:44 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description everflux 2013-01-12 18:22:57 UTC
[ BUILD # : 201301102100 ]
[ JDK VERSION : other ]

In the SQL Command view - as in other files - the user can switch between the
"source" and "history" view. In the SQL Command view this feature provides no
functionality, instead a grey are is displayed showing "No history available".
Expected behaviour: Showing either the SQL history which can be access by
ctrl+alt+shift+h, or hiding the "source" and "history" buttons from the top of
the view.
Comment 1 Jaroslav Havlin 2013-07-16 15:11:20 UTC
*** Bug 232807 has been marked as a duplicate of this bug. ***
Comment 2 matthias42 2013-07-28 11:02:26 UTC
I'm not sure whether this is a solution, but it should work. The idea: A console window is defined by the URL of the primary file (prefix "nbfs://"). If a console file is detected, not a 'normal' MultiView based TopComponent is created, but the SQLClonableEditor is directly build. This could be problematic if more MultiViewElements for text/x-sql elements are build.

# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- Base (BASE)
+++ Locally Modified (Based On LOCAL)
@@ -85,9 +85,9 @@
 import org.openide.text.CloneableEditorSupport;
 import org.openide.text.DataEditorSupport;
 import org.openide.util.*;
+import org.openide.util.lookup.Lookups;
 import org.openide.windows.CloneableOpenSupport;
 import org.openide.windows.CloneableTopComponent;
-import org.openide.windows.IOContainer;
 import org.openide.xml.XMLUtil;
 
 /** 
@@ -174,8 +174,13 @@
     
     @Override
     protected Pane createPane() {
-        Pane pane = (CloneableEditorSupport.Pane) MultiViews.createCloneableMultiView(
+        Pane pane;
+        if(getDataObject().getPrimaryFile().toURL().toExternalForm().startsWith("nbfs://")) {
+            pane = new SQLCloneableEditor(Lookups.fixed(this, getDataObject()));
+        } else {
+            pane = (CloneableEditorSupport.Pane) MultiViews.createCloneableMultiView(
                 SQLDataLoader.SQL_MIME_TYPE, getDataObject());
+        }
         return pane;
     }
Comment 3 Libor Fischmeistr 2013-11-14 10:52:37 UTC
Thank you Matthias for the patch. I think it's the best (the simplest) solution.

Patch applied: http://hg.netbeans.org/core-main/rev/5604010d8986
Comment 4 Quality Engineering 2013-11-22 02:44:52 UTC
Integrated into 'main-silver', will be available in build *201311220002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/5604010d8986
User: Libor Fischmeistr <lfischmeistr@netbeans.org>
Log: #224791: Patch for: History/source switch in SQL Command view is not useful