chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1690901 - in /chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench: TypesFrame.java swing/CreateDialog.java
Date Tue, 14 Jul 2015 11:30:07 GMT
Author: fmui
Date: Tue Jul 14 11:30:07 2015
New Revision: 1690901

URL: http://svn.apache.org/r1690901
Log:
minor Workbench improvements

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/TypesFrame.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/swing/CreateDialog.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/TypesFrame.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/TypesFrame.java?rev=1690901&r1=1690900&r2=1690901&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/TypesFrame.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/TypesFrame.java
Tue Jul 14 11:30:07 2015
@@ -53,6 +53,7 @@ import javax.swing.filechooser.FileFilte
 import javax.swing.tree.DefaultMutableTreeNode;
 import javax.swing.tree.DefaultTreeCellRenderer;
 import javax.swing.tree.DefaultTreeModel;
+import javax.swing.tree.TreeModel;
 import javax.swing.tree.TreeSelectionModel;
 
 import org.apache.chemistry.opencmis.client.api.ObjectType;
@@ -78,10 +79,11 @@ public class TypesFrame extends JFrame {
 
     private static final String WINDOW_TITLE = "CMIS Types";
 
-    private static final int BUTTON_SAVE = 0;
-    private static final int BUTTON_UPDATE = 1;
-    private static final int BUTTON_DELETE = 2;
-    private static final int BUTTON_CREATE = 3;
+    private static final int BUTTON_RELOAD = 0;
+    private static final int BUTTON_SAVE = 1;
+    private static final int BUTTON_UPDATE = 2;
+    private static final int BUTTON_DELETE = 3;
+    private static final int BUTTON_CREATE = 4;
 
     private final ClientModel model;
     private RepositoryInfo repInfo;
@@ -113,11 +115,24 @@ public class TypesFrame extends JFrame {
 
         toolBar = new JToolBar("CMIS Types Toolbar", JToolBar.HORIZONTAL);
 
-        toolbarButton = new JButton[4];
+        toolbarButton = new JButton[5];
 
         JMenuItem menuItem;
 
-        // -- save ---
+        // -- reload -.
+        toolbarButton[BUTTON_RELOAD] = new JButton("Reload");
+
+        toolbarButton[BUTTON_RELOAD].addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent event) {
+                loadData();
+            }
+        });
+        toolBar.add(toolbarButton[BUTTON_RELOAD]);
+
+        toolBar.addSeparator();
+
+        // -- save --
         final JPopupMenu savePopup = new JPopupMenu();
 
         menuItem = new JMenuItem("Save Type Definition to XML");
@@ -504,6 +519,13 @@ public class TypesFrame extends JFrame {
             typesTree.setSelectionRow(0);
         } catch (Exception ex) {
             ClientHelper.showError(null, ex);
+
+            // clear tree
+            TreeModel model = typesTree.getModel();
+            if (model instanceof DefaultTreeModel) {
+                ((DefaultTreeModel) model).setRoot(null);
+            }
+
             return;
         } finally {
             setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));

Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/swing/CreateDialog.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/swing/CreateDialog.java?rev=1690901&r1=1690900&r2=1690901&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/swing/CreateDialog.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/swing/CreateDialog.java
Tue Jul 14 11:30:07 2015
@@ -152,7 +152,7 @@ public abstract class CreateDialog exten
         if (propertyDefinitions != null) {
             int row = 0;
             for (PropertyDefinition<?> definition : propertyDefinitions.values()) {
-                if (definition.isRequired()
+                if (Boolean.TRUE.equals(definition.isRequired())
                         && !(PropertyIds.NAME.equals(definition.getId())
                                 || PropertyIds.OBJECT_TYPE_ID.equals(definition.getId())
                                 || PropertyIds.SOURCE_ID.equals(definition.getId()) || PropertyIds.TARGET_ID



Mime
View raw message