chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1432889 - /chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/LoginDialog.java
Date Mon, 14 Jan 2013 11:59:31 GMT
Author: fmui
Date: Mon Jan 14 11:59:31 2013
New Revision: 1432889

URL: http://svn.apache.org/viewvc?rev=1432889&view=rev
Log:
Workbench: added parameter to pre-select login tab

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/LoginDialog.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/LoginDialog.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/LoginDialog.java?rev=1432889&r1=1432888&r2=1432889&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/LoginDialog.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/LoginDialog.java
Mon Jan 14 11:59:31 2013
@@ -56,6 +56,8 @@ public class LoginDialog extends JDialog
 
     private static final long serialVersionUID = 1L;
 
+    public static final String SYSPROP_LOGIN_TAB = ClientSession.WORKBENCH_PREFIX + "logintab";
+
     private static ServiceLoader<AbstractLoginTab> TAB_SERVICE_LOADER = ServiceLoader.load(AbstractLoginTab.class);
 
     private JTabbedPane loginTabs;
@@ -202,6 +204,18 @@ public class LoginDialog extends JDialog
         expertLoginTab = new ExpertLoginTab();
         loginTabs.addTab(expertLoginTab.getTabTitle(), expertLoginTab);
 
+        loginTabs.setSelectedIndex(0);
+
+        String startTab = System.getProperty(SYSPROP_LOGIN_TAB, "0");
+        try {
+            int tab = Integer.parseInt(startTab);
+            if (tab >= 0 && tab < loginTabs.getTabCount()) {
+                loginTabs.setSelectedIndex(tab);
+            }
+        } catch (NumberFormatException nfe) {
+            // do nothing
+        }
+
         currentTab = (AbstractLoginTab) loginTabs.getSelectedComponent();
 
         loginTabs.addChangeListener(new ChangeListener() {



Mime
View raw message