mirror of
https://github.com/Wisser/Jailer.git
synced 2026-05-24 11:39:31 -05:00
5.3
git-svn-id: https://svn.code.sf.net/p/jailer/code/trunk@1035 3dd849cd-670e-4645-a7cd-dd197c8d0e81
This commit is contained in:
@@ -19,56 +19,23 @@ Features
|
||||
Installation
|
||||
============
|
||||
|
||||
Unpack the file jailer_n.n.n.zip. You will get the following files:
|
||||
$unzip jailer_3.6.4.zip
|
||||
$cd jailer
|
||||
$ll
|
||||
-rw-r--r-- 1 wisser users 5090 2011-08-04 08:46 build.xml
|
||||
drwxr-xr-x 2 wisser users 4096 2011-08-04 08:46 datamodel
|
||||
-rw-r--r-- 1 wisser users 3527 2011-08-04 08:46 Demo.csv
|
||||
drwxr-xr-x 2 wisser users 4096 2011-08-04 08:46 domainmodel
|
||||
-rwxr-xr-x 1 wisser users 2784 2011-08-04 08:46 driverlist.csv
|
||||
drwxr-xr-x 4 wisser users 4096 2011-08-04 08:46 epilog
|
||||
drwxr-xr-x 2 wisser users 4096 2011-08-04 08:46 example
|
||||
drwxr-xr-x 2 wisser users 4096 2011-08-04 08:46 extractionmodel
|
||||
-rw-r--r-- 1 wisser users 429 2011-08-04 08:46 jailer.bat
|
||||
-rw-r--r-- 1 wisser users 500 2011-08-04 08:46 jailerDataBrowser.bat
|
||||
-rwxr-xr-x 1 wisser users 43008 2011-08-04 08:46 jailerDataBrowser.exe
|
||||
-rwxr-xr-x 1 wisser users 444 2011-08-04 08:46 jailerDataBrowser.sh
|
||||
-rwxr-xr-x 1 wisser users 36352 2011-08-04 08:46 Jailer.exe
|
||||
-rw-r--r-- 1 wisser users 497 2011-08-04 08:46 jailerGUI.bat
|
||||
-rw-r--r-- 1 wisser users 441 2011-08-04 08:46 jailerGUI.sh
|
||||
-rw-r--r-- 1 wisser users 129 2011-08-04 08:46 Jailer.html
|
||||
-rw-r--r-- 1 wisser users 934386 2011-08-04 08:46 jailer.jar
|
||||
-rw-r--r-- 1 wisser users 378 2011-08-04 08:46 jailer.sh
|
||||
-rw-r--r-- 1 wisser users 12448 2011-08-04 08:46 jailer.xml
|
||||
drwxr-xr-x 2 wisser users 4096 2011-08-04 08:46 lib
|
||||
-rw-r--r-- 1 wisser users 1573 2011-08-04 08:46 license-prefuse.txt
|
||||
-rw-r--r-- 1 wisser users 10172 2011-08-04 08:46 license.txt
|
||||
drwxr-xr-x 4 wisser users 4096 2011-08-04 08:46 prolog
|
||||
-rw-r--r-- 1 wisser users 2340 2011-08-04 08:46 README
|
||||
-rw-r--r-- 1 wisser users 10694 2011-08-04 08:46 releasenotes.txt
|
||||
drwxr-xr-x 2 wisser users 4096 2011-08-04 08:46 render
|
||||
drwxr-xr-x 9 wisser users 4096 2011-08-04 08:46 script
|
||||
drwxr-xr-x 4 wisser users 4096 2011-08-04 08:46 src
|
||||
drwxr-xr-x 2 wisser users 4096 2011-08-04 08:46 template
|
||||
Unzip the file "jailer_<N>.zip".
|
||||
|
||||
- Database Subsetter
|
||||
|
||||
On windows platform execute "Jailer.exe". You can also start "jailerGUI.bat".
|
||||
On Unix/Linux platform execute the script "jailerGUI.sh" or use "java -jar jailer.jar"
|
||||
|
||||
|
||||
Database Subsetter
|
||||
- Data Browser
|
||||
|
||||
On windows platform execute Jailer.exe. You can also start jailerGUI.bat or start Jailer by double-clicking the jailer.jar file.
|
||||
On Unix/Linux platform execute the script jailerGUI.sh or use java -jar jailer.jar
|
||||
|
||||
|
||||
Data Browser
|
||||
|
||||
On windows platform execute jailerDataBrowser.exe, or use jailerDataBrowser.bat
|
||||
On Unix/Linux platform execute the script jailerDataBrowser.sh
|
||||
On windows platform execute "jailerDataBrowser.exe", or "jailerDataBrowser.bat"
|
||||
On Unix/Linux platform execute the script "jailerDataBrowser.sh"
|
||||
|
||||
|
||||
|
||||
|
||||
Home: http://jailer.sourceforge.net/
|
||||
Forum: https://sourceforge.net/forum/?group_id=197260
|
||||
Forum: https://sourceforge.net/p/jailer/discussion/
|
||||
Support: rwisser@users.sourceforge.net
|
||||
|
||||
|
||||
+4
-30
@@ -17,39 +17,13 @@ Features
|
||||
Installation
|
||||
============
|
||||
|
||||
Unpack the file dbeauty_n.n.n.zip. You will get the following files:
|
||||
|
||||
$unzip dbeauty_1.0.zip
|
||||
$cd dbeauty
|
||||
$ll
|
||||
-rw-r--r-- 1 wisser users 5090 2011-09-14 10:53 build.xml
|
||||
drwxr-xr-x 2 wisser users 4096 2011-09-14 10:53 datamodel
|
||||
-rw-r--r-- 1 wisser users 500 2011-09-14 10:53 dbeauty.bat
|
||||
-rwxr-xr-x 1 wisser users 43008 2011-09-14 10:53 dbeauty.exe
|
||||
-rw-r--r-- 1 wisser users 119 2011-09-14 10:53 DBeauty.html
|
||||
-rwxr-xr-x 1 wisser users 444 2011-09-14 10:53 dbeauty.sh
|
||||
-rwxr-xr-x 1 wisser users 2784 2011-09-14 10:53 driverlist.csv
|
||||
drwxr-xr-x 4 wisser users 4096 2011-09-14 10:53 epilog
|
||||
drwxr-xr-x 2 wisser users 4096 2011-09-14 10:53 extractionmodel
|
||||
-rw-r--r-- 1 wisser users 1009332 2011-09-14 10:54 jailer.jar
|
||||
-rw-r--r-- 1 wisser users 12448 2011-09-14 10:53 jailer.xml
|
||||
drwxr-xr-x 2 wisser users 4096 2011-09-14 10:53 lib
|
||||
-rw-r--r-- 1 wisser users 1573 2011-09-14 10:53 license-prefuse.txt
|
||||
-rw-r--r-- 1 wisser users 10172 2011-09-14 10:53 license.txt
|
||||
drwxr-xr-x 4 wisser users 4096 2011-09-14 10:53 prolog
|
||||
-rw-r--r-- 1 wisser users 2339 2011-09-14 10:53 README
|
||||
-rw-r--r-- 1 wisser users 25 2011-09-14 10:53 releasenotes.txt
|
||||
drwxr-xr-x 2 wisser users 4096 2011-09-14 10:53 render
|
||||
drwxr-xr-x 11 wisser users 4096 2011-09-14 10:53 script
|
||||
drwxr-xr-x 4 wisser users 4096 2011-09-14 10:53 src
|
||||
|
||||
|
||||
On windows platform execute dbeauty.exe, or use dbeauty.bat
|
||||
On Unix/Linux platform execute the script dbeauty.sh
|
||||
Unzip the file "dbeauty_<N>.zip".
|
||||
|
||||
On windows platform execute "dbeauty.exe", or use "dbeauty.bat"
|
||||
On Unix/Linux platform execute the script "dbeauty.sh"
|
||||
|
||||
|
||||
Home: http://dbeauty.sourceforge.net/
|
||||
Forum: https://sourceforge.net/apps/phpbb/dbeauty/
|
||||
Forum: https://sourceforge.net/p/dbeauty/discussion/
|
||||
Support: rwisser@users.sourceforge.net
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
2.3
|
||||
- New "Data Export" feature
|
||||
|
||||
2.2.7
|
||||
- Viewing contents of CLOB and XML column types
|
||||
|
||||
|
||||
+4
-1
@@ -1,3 +1,6 @@
|
||||
5.3
|
||||
- The Data Browser now offers a "Data Export" feature.
|
||||
|
||||
5.2.1
|
||||
- minor improvements.
|
||||
|
||||
@@ -5,7 +8,7 @@
|
||||
- Added "Closure View" and "Closure Border View" tools.
|
||||
|
||||
5.1
|
||||
- Better UI and Improved navigation.
|
||||
- Better UI and improved navigation.
|
||||
|
||||
5.0.2
|
||||
- Viewing contents of CLOB and XML column types
|
||||
|
||||
@@ -104,7 +104,7 @@ public class Jailer {
|
||||
/**
|
||||
* The Jailer version.
|
||||
*/
|
||||
public static final String VERSION = "5.2.1";
|
||||
public static final String VERSION = "5.3";
|
||||
|
||||
/**
|
||||
* The Jailer application name.
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package net.sf.jailer.ui;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.util.ArrayList;
|
||||
@@ -22,6 +23,7 @@ import java.util.List;
|
||||
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JEditorPane;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JMenuItem;
|
||||
import javax.swing.JPopupMenu;
|
||||
@@ -323,6 +325,7 @@ public class ConditionEditor extends javax.swing.JDialog {
|
||||
}
|
||||
ok = false;
|
||||
editorPane.setText(condition);
|
||||
editorPane.setCaretPosition(0);
|
||||
if (parameterSelector != null) {
|
||||
parameterSelector.updateParameters();
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<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"/>
|
||||
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,2,65,0,0,2,126"/>
|
||||
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,2,88,0,0,2,126"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
|
||||
@@ -163,6 +163,11 @@
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Component class="javax.swing.JTextField" name="where">
|
||||
<Properties>
|
||||
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[300, 2147483647]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="18" gridWidth="2" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="1" insetsRight="0" anchor="10" weightX="1.0" weightY="0.0"/>
|
||||
@@ -396,7 +401,7 @@
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="51" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="8" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
|
||||
<GridBagConstraints gridX="0" gridY="51" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="14" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
@@ -550,7 +555,10 @@
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
|
||||
</Container>
|
||||
<Container class="javax.swing.JPanel" name="jPanel5">
|
||||
<Container class="javax.swing.JPanel" name="commandLinePanel">
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="1"/>
|
||||
</AuxValues>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="85" gridWidth="4" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="0.0"/>
|
||||
@@ -586,11 +594,14 @@
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JTextArea" name="cliArea">
|
||||
<Properties>
|
||||
<Property name="columns" type="int" value="20"/>
|
||||
<Property name="editable" type="boolean" value="false"/>
|
||||
<Property name="columns" type="int" value="20"/>
|
||||
<Property name="lineWrap" type="boolean" value="true"/>
|
||||
<Property name="rows" type="int" value="5"/>
|
||||
<Property name="wrapStyleWord" type="boolean" value="true"/>
|
||||
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[300, 2147483647]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
@@ -691,6 +702,16 @@
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="openWhereEditor">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="jLabel28"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="18" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="13" weightX="0.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
|
||||
@@ -17,6 +17,7 @@ package net.sf.jailer.ui;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Cursor;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.GridBagConstraints;
|
||||
import java.awt.Point;
|
||||
import java.awt.event.ActionEvent;
|
||||
@@ -112,14 +113,19 @@ public class ExportDialog extends javax.swing.JDialog {
|
||||
private final String password;
|
||||
|
||||
/** Creates new form DbConnectionDialog
|
||||
* @param showCmd
|
||||
* @param args */
|
||||
public ExportDialog(java.awt.Frame parent, DataModel dataModel, net.sf.jailer.datamodel.Table subject, String subjectCondition, Session session, List<String> initialArgs, String password) {
|
||||
public ExportDialog(java.awt.Frame parent, final DataModel dataModel, final net.sf.jailer.datamodel.Table subject, String subjectCondition, Session session, List<String> initialArgs, String password, boolean showCmd) {
|
||||
super(parent, true);
|
||||
this.dataModel = dataModel;
|
||||
this.subject = subject;
|
||||
this.initialArgs = new ArrayList<String>(initialArgs);
|
||||
this.password = password;
|
||||
initComponents();
|
||||
|
||||
if (!showCmd) {
|
||||
commandLinePanel.setVisible(false);
|
||||
}
|
||||
|
||||
parameterEditor = new ParameterEditor(parent);
|
||||
GridBagConstraints gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
@@ -181,9 +187,9 @@ public class ExportDialog extends javax.swing.JDialog {
|
||||
|
||||
subjectTable.setText(subject.getName());
|
||||
if (subjectCondition.equals(previousInitialSubjectCondition)) {
|
||||
where.setText(previousSubjectCondition);
|
||||
where.setText(ConditionEditor.toSingleLine(previousSubjectCondition));
|
||||
} else {
|
||||
where.setText(subjectCondition);
|
||||
where.setText(ConditionEditor.toSingleLine(subjectCondition));
|
||||
}
|
||||
|
||||
initScopeButtons(session);
|
||||
@@ -250,6 +256,33 @@ public class ExportDialog extends javax.swing.JDialog {
|
||||
for (JTextField field: parameterEditor.textfieldsPerParameter.values()) {
|
||||
field.getDocument().addDocumentListener(dl);
|
||||
}
|
||||
|
||||
Dimension preferredSize = where.getPreferredSize();
|
||||
preferredSize.width = 10;
|
||||
where.setPreferredSize(preferredSize);
|
||||
|
||||
final ConditionEditor subjectConditionEditor = new ConditionEditor(null, null);
|
||||
subjectConditionEditor.setTitle("Subject condition");
|
||||
openWhereEditor.setIcon(conditionEditorIcon);
|
||||
openWhereEditor.setText(null);
|
||||
openWhereEditor.addMouseListener(new java.awt.event.MouseAdapter() {
|
||||
public void mouseClicked(java.awt.event.MouseEvent evt) {
|
||||
String cond = subjectConditionEditor.edit(where.getText(), "Subject", "T", subject, null, null, null, false);
|
||||
if (cond != null) {
|
||||
if (!where.getText().equals(ConditionEditor.toSingleLine(cond))) {
|
||||
where.setText(ConditionEditor.toSingleLine(cond));
|
||||
}
|
||||
openWhereEditor.setIcon(conditionEditorSelectedIcon);
|
||||
}
|
||||
}
|
||||
|
||||
public void mouseEntered(java.awt.event.MouseEvent evt) {
|
||||
openWhereEditor.setIcon(conditionEditorSelectedIcon);
|
||||
}
|
||||
public void mouseExited(java.awt.event.MouseEvent evt) {
|
||||
openWhereEditor.setIcon(conditionEditorIcon);
|
||||
}
|
||||
});
|
||||
updateCLIArea();
|
||||
|
||||
pack();
|
||||
@@ -583,7 +616,7 @@ public class ExportDialog extends javax.swing.JDialog {
|
||||
selectDeleteFile = new javax.swing.JLabel();
|
||||
jLabel21 = new javax.swing.JLabel();
|
||||
parameterPanel = new javax.swing.JPanel();
|
||||
jPanel5 = new javax.swing.JPanel();
|
||||
commandLinePanel = new javax.swing.JPanel();
|
||||
jLabel22 = new javax.swing.JLabel();
|
||||
jScrollPane1 = new javax.swing.JScrollPane();
|
||||
cliArea = new javax.swing.JTextArea();
|
||||
@@ -594,6 +627,7 @@ public class ExportDialog extends javax.swing.JDialog {
|
||||
placeholder1 = new javax.swing.JLabel();
|
||||
sortedCheckBox = new javax.swing.JCheckBox();
|
||||
unicode = new javax.swing.JCheckBox();
|
||||
openWhereEditor = new javax.swing.JLabel();
|
||||
jPanel7 = new javax.swing.JPanel();
|
||||
jPanel2 = new javax.swing.JPanel();
|
||||
jButton1 = new javax.swing.JButton();
|
||||
@@ -671,6 +705,8 @@ public class ExportDialog extends javax.swing.JDialog {
|
||||
gridBagConstraints.gridwidth = 2;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
|
||||
jPanel1.add(schemaMappingPanel, gridBagConstraints);
|
||||
|
||||
where.setMaximumSize(new java.awt.Dimension(300, 2147483647));
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 18;
|
||||
@@ -843,7 +879,7 @@ public class ExportDialog extends javax.swing.JDialog {
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 51;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
|
||||
gridBagConstraints.insets = new java.awt.Insets(8, 0, 0, 0);
|
||||
gridBagConstraints.insets = new java.awt.Insets(14, 0, 0, 0);
|
||||
jPanel1.add(jLabel16, gridBagConstraints);
|
||||
|
||||
jPanel8.setLayout(new java.awt.GridBagLayout());
|
||||
@@ -962,7 +998,7 @@ public class ExportDialog extends javax.swing.JDialog {
|
||||
gridBagConstraints.weightx = 1.0;
|
||||
jPanel1.add(parameterPanel, gridBagConstraints);
|
||||
|
||||
jPanel5.setLayout(new java.awt.GridBagLayout());
|
||||
commandLinePanel.setLayout(new java.awt.GridBagLayout());
|
||||
|
||||
jLabel22.setText(" Command line"); // NOI18N
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
@@ -970,15 +1006,16 @@ public class ExportDialog extends javax.swing.JDialog {
|
||||
gridBagConstraints.gridy = 0;
|
||||
gridBagConstraints.gridwidth = 2;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
|
||||
jPanel5.add(jLabel22, gridBagConstraints);
|
||||
commandLinePanel.add(jLabel22, gridBagConstraints);
|
||||
|
||||
jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
||||
|
||||
cliArea.setColumns(20);
|
||||
cliArea.setEditable(false);
|
||||
cliArea.setColumns(20);
|
||||
cliArea.setLineWrap(true);
|
||||
cliArea.setRows(5);
|
||||
cliArea.setWrapStyleWord(true);
|
||||
cliArea.setMaximumSize(new java.awt.Dimension(300, 2147483647));
|
||||
jScrollPane1.setViewportView(cliArea);
|
||||
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
@@ -989,25 +1026,25 @@ public class ExportDialog extends javax.swing.JDialog {
|
||||
gridBagConstraints.weightx = 1.0;
|
||||
gridBagConstraints.weighty = 1.0;
|
||||
gridBagConstraints.insets = new java.awt.Insets(0, 8, 0, 0);
|
||||
jPanel5.add(jScrollPane1, gridBagConstraints);
|
||||
commandLinePanel.add(jScrollPane1, gridBagConstraints);
|
||||
|
||||
jLabel23.setText(" "); // NOI18N
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 1;
|
||||
jPanel5.add(jLabel23, gridBagConstraints);
|
||||
commandLinePanel.add(jLabel23, gridBagConstraints);
|
||||
|
||||
jLabel24.setText(" "); // NOI18N
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 2;
|
||||
jPanel5.add(jLabel24, gridBagConstraints);
|
||||
commandLinePanel.add(jLabel24, gridBagConstraints);
|
||||
|
||||
jLabel25.setText(" "); // NOI18N
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 3;
|
||||
jPanel5.add(jLabel25, gridBagConstraints);
|
||||
commandLinePanel.add(jLabel25, gridBagConstraints);
|
||||
|
||||
copyButton.setText("Copy"); // NOI18N
|
||||
copyButton.setToolTipText("Copy to Clipboard"); // NOI18N
|
||||
@@ -1021,7 +1058,7 @@ public class ExportDialog extends javax.swing.JDialog {
|
||||
gridBagConstraints.gridy = 1;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
|
||||
gridBagConstraints.insets = new java.awt.Insets(0, 4, 0, 0);
|
||||
jPanel5.add(copyButton, gridBagConstraints);
|
||||
commandLinePanel.add(copyButton, gridBagConstraints);
|
||||
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
@@ -1029,7 +1066,7 @@ public class ExportDialog extends javax.swing.JDialog {
|
||||
gridBagConstraints.gridwidth = 4;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
|
||||
gridBagConstraints.weightx = 1.0;
|
||||
jPanel1.add(jPanel5, gridBagConstraints);
|
||||
jPanel1.add(commandLinePanel, gridBagConstraints);
|
||||
|
||||
placeholder1.setText(" "); // NOI18N
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
@@ -1068,6 +1105,13 @@ public class ExportDialog extends javax.swing.JDialog {
|
||||
gridBagConstraints.insets = new java.awt.Insets(2, 0, 4, 0);
|
||||
jPanel1.add(unicode, gridBagConstraints);
|
||||
|
||||
openWhereEditor.setText("jLabel28");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 18;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
|
||||
jPanel1.add(openWhereEditor, gridBagConstraints);
|
||||
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 0;
|
||||
@@ -1234,7 +1278,7 @@ public class ExportDialog extends javax.swing.JDialog {
|
||||
}
|
||||
|
||||
args.add("-where");
|
||||
args.add(where.getText());
|
||||
args.add(ConditionEditor.toMultiLine(where.getText()).replace('\n', ' ').replace('\r', ' '));
|
||||
|
||||
args.add("-format");
|
||||
args.add(scriptFormat.toString());
|
||||
@@ -1343,6 +1387,7 @@ public class ExportDialog extends javax.swing.JDialog {
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.ButtonGroup buttonGroup1;
|
||||
private javax.swing.JTextArea cliArea;
|
||||
public javax.swing.JPanel commandLinePanel;
|
||||
private javax.swing.JButton copyButton;
|
||||
private javax.swing.JTextField delete;
|
||||
public javax.swing.JCheckBox explain;
|
||||
@@ -1380,12 +1425,12 @@ public class ExportDialog extends javax.swing.JDialog {
|
||||
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.JPanel jPanel7;
|
||||
private javax.swing.JPanel jPanel8;
|
||||
private javax.swing.JScrollPane jScrollPane1;
|
||||
private javax.swing.JScrollPane jScrollPane2;
|
||||
private javax.swing.JLabel openWhereEditor;
|
||||
private javax.swing.JPanel parameterPanel;
|
||||
private javax.swing.JLabel placeholder;
|
||||
private javax.swing.JLabel placeholder1;
|
||||
@@ -1406,6 +1451,8 @@ public class ExportDialog extends javax.swing.JDialog {
|
||||
// End of variables declaration//GEN-END:variables
|
||||
|
||||
private Icon loadIcon;
|
||||
private Icon conditionEditorIcon;
|
||||
private Icon conditionEditorSelectedIcon;
|
||||
{
|
||||
String dir = "/net/sf/jailer/resource";
|
||||
|
||||
@@ -1415,6 +1462,16 @@ public class ExportDialog extends javax.swing.JDialog {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
try {
|
||||
conditionEditorIcon = new ImageIcon(getClass().getResource(dir + "/edit.png"));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
try {
|
||||
conditionEditorSelectedIcon = new ImageIcon(getClass().getResource(dir + "/edit_s.png"));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private static final long serialVersionUID = 952553009821662964L;
|
||||
|
||||
@@ -168,7 +168,6 @@ public class ExtractionModelFrame extends javax.swing.JFrame {
|
||||
return extractionModelEditor.dataModel.getParameters(extractionModelEditor.condition.getText());
|
||||
}
|
||||
});
|
||||
++numInstances;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1006,8 +1005,12 @@ public class ExtractionModelFrame extends javax.swing.JFrame {
|
||||
}//GEN-LAST:event_updateDataModelActionPerformed
|
||||
|
||||
void dataExportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dataExportActionPerformed
|
||||
openExportDialog(true);
|
||||
}//GEN-LAST:event_dataExportActionPerformed
|
||||
|
||||
public void openExportDialog(boolean checkRI) {//GEN-FIRST:event_dataExportActionPerformed
|
||||
try {
|
||||
if (extractionModelEditor.dataModel != null && !ScriptFormat.XML.equals(extractionModelEditor.scriptFormat)) {
|
||||
if (checkRI && extractionModelEditor.dataModel != null && !ScriptFormat.XML.equals(extractionModelEditor.scriptFormat)) {
|
||||
Association restrictedDependency = findRestrictedDependency(extractionModelEditor.dataModel);
|
||||
if (restrictedDependency != null) {
|
||||
switch (JOptionPane.showOptionDialog(this,
|
||||
@@ -1037,7 +1040,7 @@ public class ExtractionModelFrame extends javax.swing.JFrame {
|
||||
dbConnectionDialog.addDbArgs(args);
|
||||
Session.closeTemporaryTableSession();
|
||||
Session session = new Session(dbConnectionDialog.currentConnection.driverClass, dbConnectionDialog.currentConnection.url, dbConnectionDialog.currentConnection.user, dbConnectionDialog.getPassword());
|
||||
ExportDialog exportDialog = new ExportDialog(this, extractionModelEditor.dataModel, extractionModelEditor.getSubject(), extractionModelEditor.getSubjectCondition(), session, args, dbConnectionDialog.getPassword());
|
||||
ExportDialog exportDialog = new ExportDialog(this, extractionModelEditor.dataModel, extractionModelEditor.getSubject(), extractionModelEditor.getSubjectCondition(), session, args, dbConnectionDialog.getPassword(), checkRI);
|
||||
session.shutDown();
|
||||
Session.closeTemporaryTableSession();
|
||||
if (exportDialog.isOk()) {
|
||||
@@ -1078,7 +1081,7 @@ public class ExtractionModelFrame extends javax.swing.JFrame {
|
||||
UIUtil.showException(this, "Error", e);
|
||||
}
|
||||
}
|
||||
}//GEN-LAST:event_dataExportActionPerformed
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds restricted dependency.
|
||||
@@ -1369,10 +1372,8 @@ public class ExtractionModelFrame extends javax.swing.JFrame {
|
||||
}
|
||||
} else {
|
||||
dispose();
|
||||
UIUtil.checkTermination();
|
||||
}
|
||||
if (numInstances == 1) {
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
private void fileMenuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fileMenuActionPerformed
|
||||
@@ -1640,14 +1641,14 @@ public class ExtractionModelFrame extends javax.swing.JFrame {
|
||||
final String finalFile = file;
|
||||
if (file != null && new File(file).exists()) {
|
||||
DataModelManager.setCurrentModelSubfolder(ExtractionModel.loadDatamodelFolder(file));
|
||||
createFrame(finalFile, true);
|
||||
createFrame(finalFile, true, true);
|
||||
} else {
|
||||
DataModelManagerDialog dataModelManagerDialog = new DataModelManagerDialog(Jailer.APPLICATION_NAME + " " + Jailer.VERSION + " - Database Subsetting Tool") {
|
||||
@Override
|
||||
protected void onSelect() {
|
||||
ExtractionModelFrame extractionModelFrame = null;
|
||||
try {
|
||||
extractionModelFrame = createFrame(finalFile, true);
|
||||
extractionModelFrame = createFrame(finalFile, true, true);
|
||||
final ExtractionModelFrame finalExtractionModelFrame = extractionModelFrame;
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
@Override
|
||||
@@ -1698,7 +1699,7 @@ public class ExtractionModelFrame extends javax.swing.JFrame {
|
||||
}
|
||||
}
|
||||
|
||||
public static ExtractionModelFrame createFrame(String file, boolean maximize) {
|
||||
public static ExtractionModelFrame createFrame(String file, boolean maximize, boolean visible) {
|
||||
boolean isHorizonal = false;
|
||||
try {
|
||||
File setting = new File(ORIENTATIONSETTING);
|
||||
@@ -1719,7 +1720,7 @@ public class ExtractionModelFrame extends javax.swing.JFrame {
|
||||
}
|
||||
extractionModelFrame.setLocation(40, 40);
|
||||
extractionModelFrame.setSize(1100, 640);
|
||||
extractionModelFrame.setVisible(true);
|
||||
extractionModelFrame.setVisible(visible);
|
||||
if (maximize) {
|
||||
extractionModelFrame.setExtendedState(JFrame.MAXIMIZED_BOTH);
|
||||
}
|
||||
@@ -1803,6 +1804,5 @@ public class ExtractionModelFrame extends javax.swing.JFrame {
|
||||
// End of variables declaration//GEN-END:variables
|
||||
|
||||
private static final long serialVersionUID = -2252377308370736756L;
|
||||
private static volatile int numInstances = 0;
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ package net.sf.jailer.ui;
|
||||
import java.awt.Component;
|
||||
import java.awt.Container;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Frame;
|
||||
import java.awt.GridBagConstraints;
|
||||
import java.awt.GridBagLayout;
|
||||
import java.awt.Toolkit;
|
||||
@@ -784,4 +785,13 @@ public class UIUtil {
|
||||
}
|
||||
}
|
||||
|
||||
public static void checkTermination() {
|
||||
for (Window w: Frame.getWindows()) {
|
||||
if (w.isShowing()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ import java.awt.GridBagConstraints;
|
||||
import java.awt.Point;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.RenderingHints;
|
||||
import java.awt.Window;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.ItemEvent;
|
||||
@@ -133,7 +134,7 @@ public abstract class BrowserContentPane extends javax.swing.JPanel {
|
||||
/**
|
||||
* Allowed row limits.
|
||||
*/
|
||||
private static final Integer[] ROW_LIMITS = new Integer[] { 200, 500, 1000, 2000, 5000, 10000, 20000, 50000, 70000, 100000 };
|
||||
private static final Integer[] ROW_LIMITS = new Integer[] { 5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000, 20000, 50000, 70000, 100000 };
|
||||
|
||||
/**
|
||||
* Concurrently loads rows.
|
||||
@@ -755,7 +756,7 @@ public abstract class BrowserContentPane extends javax.swing.JPanel {
|
||||
}
|
||||
});
|
||||
limitBox.setModel(new DefaultComboBoxModel(ROW_LIMITS));
|
||||
limitBox.setSelectedIndex(association == null? 0 : 1);
|
||||
limitBox.setSelectedItem(association == null? 100 : 200);
|
||||
if (limit != null) {
|
||||
limitBox.setSelectedItem(limit);
|
||||
}
|
||||
@@ -1133,33 +1134,24 @@ public abstract class BrowserContentPane extends javax.swing.JPanel {
|
||||
});
|
||||
|
||||
popup.add(new JSeparator());
|
||||
|
||||
JMenuItem snw = new JMenuItem("Show in New Window");
|
||||
popup.add(snw);
|
||||
snw.addActionListener(new ActionListener() {
|
||||
JMenuItem exportData = new JMenuItem("Export Data");
|
||||
popup.add(exportData);
|
||||
exportData.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
showInNewWindow();
|
||||
openExtractionModelEditor(true);
|
||||
}
|
||||
});
|
||||
JMenuItem al = new JMenuItem("Append Layout...");
|
||||
popup.add(al);
|
||||
al.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
appendLayout();
|
||||
}
|
||||
});
|
||||
popup.add(new JSeparator());
|
||||
|
||||
JMenuItem extractionModel = new JMenuItem("Create Extraction Model");
|
||||
popup.add(extractionModel);
|
||||
extractionModel.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
openExtractionModelEditor();
|
||||
openExtractionModelEditor(false);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
popup.add(new JSeparator());
|
||||
|
||||
if (!forNavTree) {
|
||||
@@ -1213,6 +1205,25 @@ public abstract class BrowserContentPane extends javax.swing.JPanel {
|
||||
update.setEnabled(rows.size() > 0);
|
||||
delete.setEnabled(rows.size() > 0);
|
||||
|
||||
popup.add(new JSeparator());
|
||||
|
||||
JMenuItem snw = new JMenuItem("Show in New Window");
|
||||
popup.add(snw);
|
||||
snw.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
showInNewWindow();
|
||||
}
|
||||
});
|
||||
JMenuItem al = new JMenuItem("Append Layout...");
|
||||
popup.add(al);
|
||||
al.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
appendLayout();
|
||||
}
|
||||
});
|
||||
|
||||
popup.add(new JSeparator());
|
||||
JMenuItem m = new JMenuItem("Hide from View");
|
||||
popup.add(m);
|
||||
@@ -1239,7 +1250,7 @@ public abstract class BrowserContentPane extends javax.swing.JPanel {
|
||||
return popup;
|
||||
}
|
||||
|
||||
void openExtractionModelEditor() {
|
||||
void openExtractionModelEditor(boolean doExport) {
|
||||
Component parent = SwingUtilities.getWindowAncestor(this);
|
||||
if (parent == null) {
|
||||
parent = this;
|
||||
@@ -1274,8 +1285,9 @@ public abstract class BrowserContentPane extends javax.swing.JPanel {
|
||||
// }
|
||||
|
||||
final SbEDialog sbEDialog = new SbEDialog(SwingUtilities.getWindowAncestor(this),
|
||||
"Create Extraction Model for Subject \"" + dataModel.getDisplayName(stable) + "\".", (parents.isEmpty()? "" : ("\n\n" + parents.size() + " disregarded parent tables.")));
|
||||
(doExport? "Export rows and related rows from \"" : "Create Extraction Model for Subject \"") + dataModel.getDisplayName(stable) + "\".", (parents.isEmpty()? "" : ("\n\n" + parents.size() + " disregarded parent tables.")));
|
||||
sbEDialog.regardButton.setVisible(!parents.isEmpty());
|
||||
sbEDialog.dispose();
|
||||
DefaultTreeCellRenderer renderer = new DefaultTreeCellRenderer() {
|
||||
@Override
|
||||
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row,
|
||||
@@ -1338,9 +1350,41 @@ public abstract class BrowserContentPane extends javax.swing.JPanel {
|
||||
// }
|
||||
|
||||
subjectCondition = root.needsAnchor? root.anchorWhereClause : root.whereClause;
|
||||
if (doExport && (getParentBrowser() != null || isLimitExceeded)) {
|
||||
subjectCondition = root.whereClause;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
boolean f = true;
|
||||
for (Row row: rows) {
|
||||
if (f) {
|
||||
f = false;
|
||||
} else {
|
||||
sb.append(" or \n");
|
||||
}
|
||||
sb.append("(" + row.rowId + ")");
|
||||
}
|
||||
|
||||
if (subjectCondition != null && subjectCondition.trim().length() > 0) {
|
||||
subjectCondition = "(" + subjectCondition + ")\nand\n(" + sb + ")";
|
||||
} else {
|
||||
subjectCondition = sb.toString();
|
||||
}
|
||||
}
|
||||
if (subjectCondition == null) {
|
||||
subjectCondition = "";
|
||||
}
|
||||
// if (doExport && isLimitExceeded && rows != null && !rows.isEmpty()) {
|
||||
// StringBuilder sb = new StringBuilder();
|
||||
// boolean f = true;
|
||||
// for (Row row: rows) {
|
||||
// if (f) {
|
||||
// f = false;
|
||||
// } else {
|
||||
// sb.append(" or ");
|
||||
// }
|
||||
// sb.append("(" + row.rowId + ")");
|
||||
// }
|
||||
// subjectCondition = sb.toString();
|
||||
// }
|
||||
subjectCondition = SqlUtil.replaceAliases(subjectCondition, "T", "T");
|
||||
|
||||
for (int i = 1; ; ++i) {
|
||||
@@ -1357,14 +1401,19 @@ public abstract class BrowserContentPane extends javax.swing.JPanel {
|
||||
collectPositions(positions);
|
||||
dataModel.save(file, stable, subjectCondition, ScriptFormat.SQL, restrictionDefinitions, positions);
|
||||
|
||||
if (DataBrowserContext.isStandAlone()) {
|
||||
if (DataBrowserContext.isStandAlone() && !doExport) {
|
||||
parent.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
|
||||
JOptionPane.showMessageDialog(parent, "Jailer Extraction Model created:\n'" + file+ "'\n\nJailer Database Subsetter Tool can be found at http://jailer.sourceforge.net", "Jailer Extraction Model", JOptionPane.INFORMATION_MESSAGE);
|
||||
} else {
|
||||
ExtractionModelFrame extractionModelFrame = ExtractionModelFrame.createFrame(file, false);
|
||||
ExtractionModelFrame extractionModelFrame = ExtractionModelFrame.createFrame(file, false, !doExport);
|
||||
extractionModelFrame.setDbConnectionDialogClone(getDbConnectionDialog());
|
||||
extractionModelFrame.markDirty();
|
||||
extractionModelFrame.expandAll();
|
||||
if (doExport) {
|
||||
extractionModelFrame.openExportDialog(false);
|
||||
extractionModelFrame.dispose();
|
||||
} else {
|
||||
extractionModelFrame.markDirty();
|
||||
extractionModelFrame.expandAll();
|
||||
}
|
||||
newFile.delete();
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
@@ -1374,7 +1423,7 @@ public abstract class BrowserContentPane extends javax.swing.JPanel {
|
||||
parent.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private DefaultMutableTreeNode addChildNodes(BrowserContentPane browserContentPane, Collection<Association> restrictedDependencies, int[] count) {
|
||||
DefaultMutableTreeNode node = new DefaultMutableTreeNode(dataModel.getDisplayName(browserContentPane.table));
|
||||
count[0]++;
|
||||
|
||||
@@ -118,6 +118,24 @@
|
||||
<Property name="text" type="java.lang.String" value="Tools"/>
|
||||
</Properties>
|
||||
<SubComponents>
|
||||
<MenuItem class="javax.swing.JMenuItem" name="exportDataMenuItem">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Export Data"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="exportDataMenuItemActionPerformed"/>
|
||||
</Events>
|
||||
</MenuItem>
|
||||
<MenuItem class="javax.swing.JMenuItem" name="dataImport">
|
||||
<Properties>
|
||||
<Property name="label" type="java.lang.String" value="Import SQL Data"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="dataImportActionPerformed"/>
|
||||
</Events>
|
||||
</MenuItem>
|
||||
<MenuItem class="javax.swing.JPopupMenu$Separator" name="jSeparator8">
|
||||
</MenuItem>
|
||||
<MenuItem class="javax.swing.JMenuItem" name="createExtractionModelMenuItem">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Create Extraction Model"/>
|
||||
@@ -522,11 +540,6 @@
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JPanel" name="jPanel4">
|
||||
<Properties>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="null"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
|
||||
<JSplitPaneConstraints position="left"/>
|
||||
@@ -567,11 +580,6 @@
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JPanel" name="borderBrowserTitledPanel">
|
||||
<Properties>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="null"/>
|
||||
</Property>
|
||||
</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"/>
|
||||
|
||||
@@ -31,9 +31,7 @@ import java.awt.event.MouseEvent;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.awt.event.WindowListener;
|
||||
import java.beans.PropertyVetoException;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.PrintWriter;
|
||||
@@ -95,6 +93,7 @@ import net.sf.jailer.ui.DataModelManager;
|
||||
import net.sf.jailer.ui.DataModelManagerDialog;
|
||||
import net.sf.jailer.ui.DbConnectionDialog;
|
||||
import net.sf.jailer.ui.DbConnectionDialog.ConnectionInfo;
|
||||
import net.sf.jailer.ui.ExtractionModelFrame;
|
||||
import net.sf.jailer.ui.UIUtil;
|
||||
import net.sf.jailer.ui.databrowser.Desktop.LayoutMode;
|
||||
import net.sf.jailer.ui.databrowser.Desktop.RowBrowser;
|
||||
@@ -273,6 +272,7 @@ public class DataBrowser extends javax.swing.JFrame {
|
||||
@Override
|
||||
protected void updateMenu(boolean hasTableBrowser, boolean hasIFrame) {
|
||||
storeSessionItem.setEnabled(hasIFrame);
|
||||
exportDataMenuItem.setEnabled(hasTableBrowser);
|
||||
createExtractionModelMenuItem.setEnabled(hasTableBrowser);
|
||||
updateIFramesBar();
|
||||
super.updateMenu(hasTableBrowser, hasIFrame);
|
||||
@@ -330,6 +330,7 @@ public class DataBrowser extends javax.swing.JFrame {
|
||||
@Override
|
||||
public void windowClosed(WindowEvent e) {
|
||||
desktop.stop();
|
||||
UIUtil.checkTermination();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -634,6 +635,9 @@ public class DataBrowser extends javax.swing.JFrame {
|
||||
analyseMenuItem = new javax.swing.JMenuItem();
|
||||
dataModelEditorjMenuItem = new javax.swing.JMenuItem();
|
||||
jMenu2 = new javax.swing.JMenu();
|
||||
exportDataMenuItem = new javax.swing.JMenuItem();
|
||||
dataImport = new javax.swing.JMenuItem();
|
||||
jSeparator8 = new javax.swing.JPopupMenu.Separator();
|
||||
createExtractionModelMenuItem = new javax.swing.JMenuItem();
|
||||
menuWindow = new javax.swing.JMenu();
|
||||
layoutMenuItem = new javax.swing.JMenuItem();
|
||||
@@ -659,7 +663,7 @@ public class DataBrowser extends javax.swing.JFrame {
|
||||
legende1.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
|
||||
legende1.setLayout(new java.awt.GridBagLayout());
|
||||
|
||||
modelName.setFont(new java.awt.Font("Dialog", 0, 12));
|
||||
modelName.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
|
||||
modelName.setText("Data Model \"Demo\"");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
@@ -668,7 +672,7 @@ public class DataBrowser extends javax.swing.JFrame {
|
||||
gridBagConstraints.insets = new java.awt.Insets(0, 8, 0, 12);
|
||||
legende1.add(modelName, gridBagConstraints);
|
||||
|
||||
modelPath.setFont(new java.awt.Font("Dialog", 0, 12));
|
||||
modelPath.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
|
||||
modelPath.setForeground(java.awt.Color.gray);
|
||||
modelPath.setText("/home/jailer/datamodel/");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
@@ -690,22 +694,22 @@ public class DataBrowser extends javax.swing.JFrame {
|
||||
legende.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
|
||||
legende.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 0, 0));
|
||||
|
||||
dependsOn.setFont(new java.awt.Font("Dialog", 0, 12));
|
||||
dependsOn.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
|
||||
dependsOn.setForeground(new java.awt.Color(170, 0, 0));
|
||||
dependsOn.setText(" depends on");
|
||||
legende.add(dependsOn);
|
||||
|
||||
hasDependent.setFont(new java.awt.Font("Dialog", 0, 12));
|
||||
hasDependent.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
|
||||
hasDependent.setForeground(new java.awt.Color(0, 112, 0));
|
||||
hasDependent.setText(" has dependent");
|
||||
legende.add(hasDependent);
|
||||
|
||||
associatedWith.setFont(new java.awt.Font("Dialog", 0, 12));
|
||||
associatedWith.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
|
||||
associatedWith.setForeground(new java.awt.Color(0, 100, 255));
|
||||
associatedWith.setText(" associated with");
|
||||
legende.add(associatedWith);
|
||||
|
||||
ignored.setFont(new java.awt.Font("Dialog", 0, 12));
|
||||
ignored.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
|
||||
ignored.setForeground(new java.awt.Color(153, 153, 153));
|
||||
ignored.setText(" disabled ");
|
||||
legende.add(ignored);
|
||||
@@ -720,7 +724,7 @@ public class DataBrowser extends javax.swing.JFrame {
|
||||
schemaNamePanel.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
|
||||
schemaNamePanel.setLayout(new java.awt.GridBagLayout());
|
||||
|
||||
schemaName.setFont(new java.awt.Font("Dialog", 0, 12));
|
||||
schemaName.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
|
||||
schemaName.setText("Schema");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
@@ -743,7 +747,7 @@ public class DataBrowser extends javax.swing.JFrame {
|
||||
legende2.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
|
||||
legende2.setLayout(new java.awt.GridBagLayout());
|
||||
|
||||
connectivityState.setFont(new java.awt.Font("Dialog", 0, 12));
|
||||
connectivityState.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
|
||||
connectivityState.setText("offline");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
@@ -782,7 +786,6 @@ public class DataBrowser extends javax.swing.JFrame {
|
||||
jSplitPane2.setContinuousLayout(true);
|
||||
jSplitPane2.setOneTouchExpandable(true);
|
||||
|
||||
jPanel4.setBorder(null);
|
||||
jPanel4.setLayout(new java.awt.GridBagLayout());
|
||||
|
||||
navigationTree.addMouseListener(new java.awt.event.MouseAdapter() {
|
||||
@@ -810,7 +813,6 @@ public class DataBrowser extends javax.swing.JFrame {
|
||||
|
||||
jSplitPane2.setLeftComponent(jPanel4);
|
||||
|
||||
borderBrowserTitledPanel.setBorder(null);
|
||||
borderBrowserTitledPanel.setLayout(new java.awt.GridBagLayout());
|
||||
|
||||
titleLabel.setText(" ");
|
||||
@@ -976,6 +978,23 @@ public class DataBrowser extends javax.swing.JFrame {
|
||||
|
||||
jMenu2.setText("Tools");
|
||||
|
||||
exportDataMenuItem.setText("Export Data");
|
||||
exportDataMenuItem.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
exportDataMenuItemActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
jMenu2.add(exportDataMenuItem);
|
||||
|
||||
dataImport.setLabel("Import SQL Data");
|
||||
dataImport.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
dataImportActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
jMenu2.add(dataImport);
|
||||
jMenu2.add(jSeparator8);
|
||||
|
||||
createExtractionModelMenuItem.setText("Create Extraction Model");
|
||||
createExtractionModelMenuItem.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
@@ -1092,6 +1111,35 @@ public class DataBrowser extends javax.swing.JFrame {
|
||||
pack();
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void exportDataMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exportDataMenuItemActionPerformed
|
||||
desktop.createExtractionModel(true);
|
||||
}//GEN-LAST:event_exportDataMenuItemActionPerformed
|
||||
|
||||
private void dataImportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dataImportActionPerformed
|
||||
try {
|
||||
String sqlFile = UIUtil.choseFile(null, ".", "Data Import", ".sql", this, false, true);
|
||||
if (sqlFile != null) {
|
||||
List<String> args = new ArrayList<String>();
|
||||
args.add("import");
|
||||
args.add(sqlFile);
|
||||
dbConnectionDialog.addDbArgs(args);
|
||||
UIUtil.runJailer(this, args, false, true, false, false, null, dbConnectionDialog.getPassword(), null, null, false, true, false);
|
||||
if (desktop != null) {
|
||||
desktop.updateMenu();
|
||||
for (RowBrowser rb : desktop.getBrowsers()) {
|
||||
rb.browserContentPane.session = session;
|
||||
rb.browserContentPane.rows.clear();
|
||||
}
|
||||
for (RowBrowser rb : desktop.getRootBrowsers(false)) {
|
||||
rb.browserContentPane.reloadRows();
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
UIUtil.showException(this, "Error", e);
|
||||
}
|
||||
}//GEN-LAST:event_dataImportActionPerformed
|
||||
|
||||
private void newWindowMenuItemActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_newWindowMenuItemActionPerformed
|
||||
try {
|
||||
openNewDataBrowser(datamodel.get(), dbConnectionDialog, false);
|
||||
@@ -1146,7 +1194,7 @@ public class DataBrowser extends javax.swing.JFrame {
|
||||
}// GEN-LAST:event_jMenuItem4ActionPerformed
|
||||
|
||||
private void createExtractionModelMenuItemActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_createExtractionModelMenuItemActionPerformed
|
||||
desktop.createExtractionModel();
|
||||
desktop.createExtractionModel(false);
|
||||
}// GEN-LAST:event_createExtractionModelMenuItemActionPerformed
|
||||
|
||||
private void storeSessionItemActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_storeSessionItemActionPerformed
|
||||
@@ -1507,8 +1555,10 @@ public class DataBrowser extends javax.swing.JFrame {
|
||||
private javax.swing.JMenuItem cloaseAllMenuItem;
|
||||
public javax.swing.JLabel connectivityState;
|
||||
private javax.swing.JMenuItem createExtractionModelMenuItem;
|
||||
private javax.swing.JMenuItem dataImport;
|
||||
private javax.swing.JMenuItem dataModelEditorjMenuItem;
|
||||
private javax.swing.JLabel dependsOn;
|
||||
private javax.swing.JMenuItem exportDataMenuItem;
|
||||
private javax.swing.JLabel hasDependent;
|
||||
private javax.swing.JMenuItem helpForum;
|
||||
private javax.swing.JMenu helpMenu;
|
||||
@@ -1536,6 +1586,7 @@ public class DataBrowser extends javax.swing.JFrame {
|
||||
private javax.swing.JPopupMenu.Separator jSeparator5;
|
||||
private javax.swing.JPopupMenu.Separator jSeparator6;
|
||||
private javax.swing.JPopupMenu.Separator jSeparator7;
|
||||
private javax.swing.JPopupMenu.Separator jSeparator8;
|
||||
private javax.swing.JSplitPane jSplitPane1;
|
||||
private javax.swing.JSplitPane jSplitPane2;
|
||||
private javax.swing.JRadioButtonMenuItem largeLayoutRadioButtonMenuItem;
|
||||
|
||||
@@ -28,7 +28,7 @@ import net.sf.jailer.Jailer;
|
||||
public class DataBrowserContext {
|
||||
|
||||
private static String STANDALONE_APP_NAME = "DBeauty";
|
||||
private static String STANDALONE_APP_VERSION = "2.2.7";
|
||||
private static String STANDALONE_APP_VERSION = "2.3";
|
||||
|
||||
private static boolean supportsDataModelUpdates = true;
|
||||
private static Boolean standAlone = null;
|
||||
|
||||
@@ -2233,7 +2233,7 @@ public abstract class Desktop extends JDesktopPane {
|
||||
/**
|
||||
* Lets user chose a table browser and creates an extraction model for it.
|
||||
*/
|
||||
public void createExtractionModel() {
|
||||
public void createExtractionModel(boolean doExport) {
|
||||
Set<String> titles = new TreeSet<String>();
|
||||
Map<String, RowBrowser> rowBrowserByTitle = new HashMap<String, Desktop.RowBrowser>();
|
||||
for (RowBrowser rb : tableBrowsers) {
|
||||
@@ -2245,7 +2245,7 @@ public abstract class Desktop extends JDesktopPane {
|
||||
String s = (String) JOptionPane.showInputDialog(this.parentFrame, "Select subject table", "Subject", JOptionPane.QUESTION_MESSAGE, null,
|
||||
titles.toArray(), null);
|
||||
if (s != null) {
|
||||
rowBrowserByTitle.get(s).browserContentPane.openExtractionModelEditor();
|
||||
rowBrowserByTitle.get(s).browserContentPane.openExtractionModelEditor(doExport);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user