Skip to content

Commit

Permalink
feat: add detail and warning message for OracleEE profile
Browse files Browse the repository at this point in the history
  • Loading branch information
akardapolov committed Aug 28, 2019
1 parent 1007d49 commit 9921ba2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
21 changes: 18 additions & 3 deletions ashv/src/main/java/gui/connect/ConnectToDbArea.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class ConnectToDbArea extends JDialog {

private JButton startStopButton;

private int width = 300;
private int width = 340;
private int height = 340;

private DefaultTableModel modelConn;
Expand All @@ -83,6 +83,10 @@ public class ConnectToDbArea extends JDialog {
private JLabel urlLbl = new JLabel(Labels.getLabel("gui.connection.url"));

private JLabel profileNameLbl = new JLabel(Labels.getLabel("gui.connection.name"),SwingConstants.LEADING);

private JLabel profileDetailLbl = new JLabel(Labels.getLabel("gui.connection.profile.detail"));
private JLabel profileMessageLbl = new JLabel(Labels.getLabel("gui.connection.profile.message"));

private JLabel offlineLbl = new JLabel(Labels.getLabel("gui.connection.offline"));

private JTextField connNameTF = new JTextField();
Expand Down Expand Up @@ -128,7 +132,7 @@ public ConnectToDbArea(BasicFrame jFrame,
private void init(){
//MigLayout lmMain = new MigLayout("debug", "[grow][][grow]", "[][][]");
MigLayout lmMain = new MigLayout("", "[grow][][grow]", "[][][]");
MigLayout lmDetail = new MigLayout("ins 10", "[para]0[grow][100lp, fill][60lp][95lp, fill]", "");
MigLayout lmDetail = new MigLayout("ins 10", "[para]0[grow][150lp, fill][60lp][95lp, fill]", "");
MigLayout lmButtonPanel = new MigLayout("fillx", "[50lp][50lp][50lp][50lp]");

mainJPanel = new JPanel(lmMain);
Expand Down Expand Up @@ -217,6 +221,9 @@ private void init_gui(){
detailJPanel.add(profileNameLbl, "skip");
detailJPanel.add(profileBox, "span, growx");

detailJPanel.add(profileDetailLbl, "skip");
detailJPanel.add(profileMessageLbl, "span, growx");

detailJPanel.add(openFileButton, "skip, wmin 30");
detailJPanel.add(jarTF, "span, growx, wmin 150");

Expand Down Expand Up @@ -350,7 +357,7 @@ private void init_gui(){

mainJPanel.add(buttonPanel, "wrap, span 2, wmin 200");
mainJPanel.add(tableDataPaneConn, "growy, span 1, wmin 150");
mainJPanel.add(detailJPanel, "top, growx, wmin 150");
mainJPanel.add(detailJPanel, "top, growx, wmin 200");

JdialogComponentListener jdialogComponentListener = new JdialogComponentListener();
this.addComponentListener(jdialogComponentListener);
Expand Down Expand Up @@ -403,6 +410,14 @@ private void selectFromDbAndSetInGui(String connName){
profileBox.setSelectedItem(this.storeManager.getRepositoryDAO().getMetaDataAttributeValue(
Labels.getLabel("local.sql.metadata.connection"),
connName, Labels.getLabel("local.sql.metadata.connection.profile")));

String selItem = (String) profileBox.getSelectedItem();
if (selItem != null && selItem.equalsIgnoreCase(String.valueOf(ConstantManager.Profile.OracleEE))) {
profileMessageLbl.setVisible(true);
} else {
profileMessageLbl.setVisible(false);
}

}

private void saveData(){
Expand Down
3 changes: 3 additions & 0 deletions ashv/src/main/resources/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ gui.connection.url.hint=jdbc:oracle:thin:@host:PORT:SID
gui.connection.url.tooltip=jdbc:oracle:thin:@host:PORT:SID or jdbc:postgresql://host:PORT/db
gui.connection.jar.hint=Open JDBC Driver jar file

gui.connection.profile.detail=Detail
gui.connection.profile.message=Enterprise edition must have Diagnostic pack license purchased

gui.connection.jar=JAR file
gui.connection.offline=Offline
gui.connection.open=JAR file
Expand Down

0 comments on commit 9921ba2

Please sign in to comment.