GUI Improvements and bug fixes

This commit is contained in:
Wisser
2018-04-09 09:22:50 +02:00
parent b740ae684a
commit 462d64a5ba
8 changed files with 246 additions and 213 deletions
+3
View File
@@ -1,3 +1,6 @@
7.6.8
- SQL-Console: GUI Improvements and bug fixes.
7.6.7
- SQL-Console: added support for substitution variables.
- Fixed a bug concerning SQL outline rendering.
@@ -25,7 +25,7 @@ public class JailerVersion {
/**
* The Jailer version.
*/
public static final String VERSION = "7.6.7";
public static final String VERSION = "7.6.8";
/**
* The Jailer working tables version.
@@ -3042,6 +3042,9 @@ public abstract class BrowserContentPane extends javax.swing.JPanel {
}
for (int i = 0; i < columnNames.length; ++i) {
columnNames[i] = columns.get(i).name;
if ("".equals(columnNames[i])) {
columnNames[i] = " ";
}
if (pkColumnNames.contains(columnNames[i])) {
pkColumns.add(i);
}
@@ -56,7 +56,6 @@ import javax.swing.InputMap;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JInternalFrame;
import javax.swing.JLabel;
import javax.swing.JLayeredPane;
@@ -1987,7 +1986,7 @@ public class DataBrowser extends javax.swing.JFrame {
}
private static DataBrowser openNewDataBrowser(DataModel datamodel, DbConnectionDialog dbConnectionDialog, boolean maximize, ExecutionContext executionContext, DataBrowser theDataBrowser) throws Exception {
DataBrowser dataBrowser = theDataBrowser != null? theDataBrowser : new DataBrowser(datamodel, null, "", null, false, executionContext);
final DataBrowser dataBrowser = theDataBrowser != null? theDataBrowser : new DataBrowser(datamodel, null, "", null, false, executionContext);
dataBrowser.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
// if (maximize) {
// dataBrowser.setExtendedState(JFrame.MAXIMIZED_BOTH);
@@ -2027,6 +2026,12 @@ public class DataBrowser extends javax.swing.JFrame {
}
}
}
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
dataBrowser.toFront();
}
});
return dataBrowser;
}
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
<SubComponents>
<Component class="javax.swing.JLabel" name="iconLabel">
<Properties>
<Property name="text" type="java.lang.String" value="erroricon"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="1" gridY="1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="11" weightX="0.0" weightY="1.0"/>
</Constraint>
</Constraints>
</Component>
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="2" gridY="1" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="1.0"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTextArea" name="errorTextArea">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="ff" green="ff" red="fe" type="rgb"/>
</Property>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="0" green="0" id="red" palette="1" red="ff" type="palette"/>
</Property>
</Properties>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Form>
@@ -0,0 +1,90 @@
/*
* Copyright 2007 - 2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.sf.jailer.ui.databrowser.sqlconsole;
import javax.swing.Icon;
import javax.swing.UIManager;
/**
* SQL-Console error view.
*
* @author Ralf Wisser
*/
public class ErrorPanel extends javax.swing.JPanel {
/**
* Creates new form ErrorPanel.
*
* @param errorMessage the error message
*/
public ErrorPanel(String errorMessage) {
initComponents();
errorTextArea.setText(errorMessage);
errorTextArea.setCaretPosition(0);
iconLabel.setText(null);
try {
Icon errorIcon = UIManager.getIcon("OptionPane.errorIcon");
iconLabel.setIcon(errorIcon);
} catch (Throwable t) {
// ignore
}
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
java.awt.GridBagConstraints gridBagConstraints;
iconLabel = new javax.swing.JLabel();
jScrollPane1 = new javax.swing.JScrollPane();
errorTextArea = new javax.swing.JTextArea();
setLayout(new java.awt.GridBagLayout());
iconLabel.setText("erroricon");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 1;
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
gridBagConstraints.weighty = 1.0;
add(iconLabel, gridBagConstraints);
errorTextArea.setEditable(false);
errorTextArea.setBackground(new java.awt.Color(254, 255, 255));
errorTextArea.setForeground(java.awt.Color.red);
jScrollPane1.setViewportView(errorTextArea);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 2;
gridBagConstraints.gridy = 1;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.weighty = 1.0;
add(jScrollPane1, gridBagConstraints);
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JTextArea errorTextArea;
private javax.swing.JLabel iconLabel;
private javax.swing.JScrollPane jScrollPane1;
// End of variables declaration//GEN-END:variables
}
@@ -138,60 +138,15 @@
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container>
<Container class="javax.swing.JSplitPane" name="jSplitPane1">
<Properties>
<Property name="orientation" type="int" value="0"/>
<Property name="oneTouchExpandable" type="boolean" value="true"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
<JSplitPaneConstraints position="right"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel6">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
<JSplitPaneConstraints position="left"/>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="1" gridY="2" gridWidth="4" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel3">
<Properties>
<Property name="text" type="java.lang.String" value=" "/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="1" gridY="2" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="jLabel6">
<Properties>
<Property name="text" type="java.lang.String" value=" "/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="1" gridY="5" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="jLabel7">
<Properties>
<Property name="text" type="java.lang.String" value=" "/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="1" gridY="6" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="statusLabel">
<Properties>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
@@ -201,77 +156,34 @@
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="1" gridY="1" gridWidth="1" gridHeight="20" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="15" weightX="1.0" weightY="1.0"/>
</Constraint>
</Constraints>
</Component>
<Container class="javax.swing.JPanel" name="jPanel4">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="1" gridY="2" gridWidth="1" gridHeight="20" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="1.0"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
<SubComponents>
<Container class="javax.swing.JScrollPane" name="statusScrollPane">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="1" gridY="1" gridWidth="1" gridHeight="40" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="15" weightX="1.0" weightY="1.0"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTextPane" name="statusTextPane">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="0" green="0" id="red" palette="1" red="ff" type="palette"/>
</Property>
</Properties>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container>
<Component class="javax.swing.JLabel" name="jLabel4">
<Properties>
<Property name="text" type="java.lang.String" value=" "/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="1" gridY="3" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
<GridBagConstraints gridX="1" gridY="1" gridWidth="1" gridHeight="20" fill="2" ipadX="0" ipadY="0" insetsTop="2" insetsLeft="8" insetsBottom="10" insetsRight="0" anchor="15" weightX="1.0" weightY="1.0"/>
</Constraint>
</Constraints>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel3">
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel3">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
<JSplitPaneConstraints position="right"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
<SubComponents>
<Container class="javax.swing.JTabbedPane" name="jTabbedPane1">
<Properties>
<Property name="tabLayoutPolicy" type="int" value="1"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
<JSplitPaneConstraints position="right"/>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="Center"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
<SubComponents>
<Container class="javax.swing.JTabbedPane" name="jTabbedPane1">
<Properties>
<Property name="tabLayoutPolicy" type="int" value="1"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="Center"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/>
</Container>
</SubComponents>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/>
</Container>
</SubComponents>
</Container>
@@ -48,7 +48,6 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
@@ -112,7 +111,6 @@ import net.sf.jailer.ui.databrowser.metadata.MetaDataPanel;
import net.sf.jailer.ui.databrowser.metadata.MetaDataPanel.OutlineInfo;
import net.sf.jailer.ui.databrowser.metadata.MetaDataSource;
import net.sf.jailer.ui.databrowser.metadata.ResultSetRenderer;
import net.sf.jailer.ui.syntaxtextarea.BasicFormatterImpl;
import net.sf.jailer.ui.syntaxtextarea.RSyntaxTextAreaWithSQLSyntaxStyle;
import net.sf.jailer.ui.syntaxtextarea.SQLAutoCompletion;
import net.sf.jailer.ui.syntaxtextarea.SQLCompletionProvider;
@@ -417,7 +415,6 @@ public abstract class SQLConsole extends javax.swing.JPanel {
private void resetStatus() {
statusLabel.setVisible(false);
statusScrollPane.setVisible(false);
cancelButton.setEnabled(false);
}
@@ -746,6 +743,7 @@ public abstract class SQLConsole extends javax.swing.JPanel {
updateColumnsAndTextView(rb, tabContentPanel);
}
});
removeLastErrorTab();
jTabbedPane1.add(rTabContainer);
jTabbedPane1.setTabComponentAt(jTabbedPane1.indexOfComponent(rTabContainer), getTitlePanel(jTabbedPane1, rTabContainer, title));
@@ -1070,26 +1068,26 @@ public abstract class SQLConsole extends javax.swing.JPanel {
try {
synchronized (Status.this) {
Font font = new JLabel("X").getFont();
statusLabel.setFont(new Font(font.getName(), font.getStyle(), (font.getSize() * 13) / 10));
statusLabel.setFont(new Font(font.getName(), font.getStyle(), (font.getSize() * 14) / 10));
statusLabel.setVisible(false);
cancelButton.setEnabled(false);
statusScrollPane.setVisible(false);
if (!failed) {
cancelButton.setEnabled(running);
statusLabel.setVisible(true);
statusLabel.setForeground(running? new Color(0, 100, 0) : Color.BLACK);
statusLabel.setText(getText());
} else {
statusScrollPane.setVisible(true);
statusLabel.setVisible(true);
if (error instanceof CancellationException) {
statusTextPane.setText("Cancelled");
statusLabel.setForeground(Color.RED);
statusLabel.setText("Cancelled");
} else if (error instanceof SQLException) {
String pos = "";
int errorLine = -1;
try {
errorLine = editorPane.getLineOfOffset(errorPosition);
if (errorPositionIsKnown) {
int col = errorPosition - editorPane.getLineStartOffset(errorLine);
int col = errorPosition - editorPane.getLineStartOffset(errorLine) + 1;
pos = "Error at line " + (errorLine + 1) + ", column " + col + ": ";
}
editorPane.setCaretPosition(errorPosition);
@@ -1099,7 +1097,7 @@ public abstract class SQLConsole extends javax.swing.JPanel {
if (errorLine >= 0) {
editorPane.setLineTrackingIcon(errorLine, scaledCancelIcon);
}
statusTextPane.setText(pos + error.getMessage()
showError(pos + error.getMessage()
+ (sqlFragment == null? "" :
"\nSQL: \"" + (sqlFragment.trim()) + "\""));
} else {
@@ -1107,9 +1105,8 @@ public abstract class SQLConsole extends javax.swing.JPanel {
PrintWriter pw = new PrintWriter(sw);
error.printStackTrace(pw);
String sStackTrace = sw.toString(); // stack trace as a string
statusTextPane.setText(sStackTrace);
showError(sStackTrace);
}
statusTextPane.setCaretPosition(0);
}
}
Color failedColor = new Color(255, 200, 200);
@@ -1141,7 +1138,6 @@ public abstract class SQLConsole extends javax.swing.JPanel {
}
}
jPanel4.revalidate();
jPanel2.repaint();
if (withDDL && !running) {
@@ -1156,7 +1152,7 @@ public abstract class SQLConsole extends javax.swing.JPanel {
}
}
private String getText() {
private String getText() {
String text = "";
if (running) {
text = "Running... ";
@@ -1181,6 +1177,34 @@ public abstract class SQLConsole extends javax.swing.JPanel {
}
}
private void showError(String errorMessage) {
statusLabel.setVisible(true);
statusLabel.setForeground(Color.RED);
statusLabel.setText("Error");
removeLastErrorTab();
JComponent rTabContainer = new ErrorPanel(errorMessage);
jTabbedPane1.add(rTabContainer);
jTabbedPane1.setTabComponentAt(jTabbedPane1.indexOfComponent(rTabContainer), getTitlePanel(jTabbedPane1, rTabContainer, "Error"));
if (jTabbedPane1.getTabCount() > MAX_TAB_COUNT) {
jTabbedPane1.remove(0);
}
jTabbedPane1.setSelectedIndex(jTabbedPane1.getTabCount() - 1);
jTabbedPane1.repaint();
}
private void removeLastErrorTab() {
if (jTabbedPane1.getTabCount() > 0) {
if (jTabbedPane1.getTabComponentAt(jTabbedPane1.getTabCount() - 1) instanceof TitelPanel) {
if (((TitelPanel) jTabbedPane1.getTabComponentAt(jTabbedPane1.getTabCount() - 1)).rTabContainer instanceof ErrorPanel) {
jTabbedPane1.removeTabAt(jTabbedPane1.getTabCount() - 1);
}
}
}
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
@@ -1202,16 +1226,8 @@ public abstract class SQLConsole extends javax.swing.JPanel {
runSQLButton = new javax.swing.JButton();
runnAllButton = new javax.swing.JButton();
explainButton = new javax.swing.JButton();
jSplitPane1 = new javax.swing.JSplitPane();
jPanel6 = new javax.swing.JPanel();
jLabel3 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
statusLabel = new javax.swing.JLabel();
jPanel4 = new javax.swing.JPanel();
statusScrollPane = new javax.swing.JScrollPane();
statusTextPane = new javax.swing.JTextPane();
jLabel4 = new javax.swing.JLabel();
jPanel3 = new javax.swing.JPanel();
jTabbedPane1 = new javax.swing.JTabbedPane();
@@ -1252,8 +1268,7 @@ public abstract class SQLConsole extends javax.swing.JPanel {
cancelButton.setText("Cancel");
cancelButton.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent evt) {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cancelButtonActionPerformed(evt);
}
});
@@ -1289,31 +1304,8 @@ public abstract class SQLConsole extends javax.swing.JPanel {
gridBagConstraints.weightx = 1.0;
jPanel2.add(jPanel5, gridBagConstraints);
jSplitPane2.setLeftComponent(jPanel2);
jSplitPane1.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
jSplitPane1.setOneTouchExpandable(true);
jPanel6.setLayout(new java.awt.GridBagLayout());
jLabel3.setText(" ");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 2;
jPanel6.add(jLabel3, gridBagConstraints);
jLabel6.setText(" ");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 5;
jPanel6.add(jLabel6, gridBagConstraints);
jLabel7.setText(" ");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 6;
jPanel6.add(jLabel7, gridBagConstraints);
statusLabel.setForeground(java.awt.Color.gray);
statusLabel.setText(" ctrl-space for code completion");
gridBagConstraints = new java.awt.GridBagConstraints();
@@ -1324,49 +1316,24 @@ public abstract class SQLConsole extends javax.swing.JPanel {
gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTH;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.weighty = 1.0;
gridBagConstraints.insets = new java.awt.Insets(2, 8, 10, 0);
jPanel6.add(statusLabel, gridBagConstraints);
jPanel4.setLayout(new java.awt.GridBagLayout());
statusTextPane.setEditable(false);
statusTextPane.setForeground(java.awt.Color.red);
statusScrollPane.setViewportView(statusTextPane);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 1;
gridBagConstraints.gridheight = 40;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTH;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.weighty = 1.0;
jPanel4.add(statusScrollPane, gridBagConstraints);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 2;
gridBagConstraints.gridheight = 20;
gridBagConstraints.gridwidth = 4;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.weighty = 1.0;
jPanel6.add(jPanel4, gridBagConstraints);
jPanel2.add(jPanel6, gridBagConstraints);
jLabel4.setText(" ");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 3;
jPanel6.add(jLabel4, gridBagConstraints);
jSplitPane1.setLeftComponent(jPanel6);
jSplitPane2.setLeftComponent(jPanel2);
jPanel3.setLayout(new java.awt.BorderLayout());
jTabbedPane1.setTabLayoutPolicy(javax.swing.JTabbedPane.SCROLL_TAB_LAYOUT);
jPanel3.add(jTabbedPane1, java.awt.BorderLayout.CENTER);
jSplitPane1.setRightComponent(jPanel3);
jSplitPane2.setRightComponent(jSplitPane1);
jSplitPane2.setRightComponent(jPanel3);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
@@ -1394,25 +1361,17 @@ public abstract class SQLConsole extends javax.swing.JPanel {
private javax.swing.JPanel consoleContainerPanel;
private javax.swing.JButton explainButton;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JPanel jPanel4;
private javax.swing.JPanel jPanel5;
private javax.swing.JPanel jPanel6;
private javax.swing.JSplitPane jSplitPane1;
private javax.swing.JSplitPane jSplitPane2;
private javax.swing.JTabbedPane jTabbedPane1;
private javax.swing.JComboBox limitComboBox;
private javax.swing.JButton runSQLButton;
private javax.swing.JButton runnAllButton;
private javax.swing.JLabel statusLabel;
private javax.swing.JScrollPane statusScrollPane;
private javax.swing.JTextPane statusTextPane;
// End of variables declaration//GEN-END:variables
class ResultContentPane extends BrowserContentPane {
@@ -1550,28 +1509,35 @@ public abstract class SQLConsole extends javax.swing.JPanel {
}
};
private JPanel getTitlePanel(final JTabbedPane tabbedPane, final JComponent rTabContainer, String title) {
JPanel titlePanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
titlePanel.setOpaque(false);
JLabel titleLbl = new JLabel(title);
titleLbl.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5));
titlePanel.add(titleLbl);
SmallButton closeButton = new SmallButton(closeIcon) {
@Override
protected void onClick() {
tabbedPane.remove(rTabContainer);
}
};
titlePanel.add(closeButton);
return titlePanel;
private class TitelPanel extends JPanel {
public final JComponent rTabContainer;
public TitelPanel(final JTabbedPane tabbedPane, final JComponent rTabContainer, String title) {
super(new FlowLayout(FlowLayout.LEFT, 0, 0));
this.rTabContainer = rTabContainer;
setOpaque(false);
JLabel titleLbl = new JLabel(title);
titleLbl.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5));
add(titleLbl);
SmallButton closeButton = new SmallButton(closeIcon) {
@Override
protected void onClick() {
tabbedPane.remove(rTabContainer);
}
};
add(closeButton);
}
}
private JPanel getTitlePanel(final JTabbedPane tabbedPane, final JComponent rTabContainer, String title) {
return new TitelPanel(tabbedPane, rTabContainer, title);
}
@Override
public void grabFocus() {
editorPane.grabFocus();
}
private Icon closeIcon;
{
String dir = "/net/sf/jailer/ui/resource";