[jboss-svn-commits] JBL Code SVN: r31967 - labs/jbossrules/branches/factsConstraints_baunax_esteban/drools-guvnor/src/main/java/org/drools/guvnor/client/explorer.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Mar 5 15:57:04 EST 2010


Author: baunax
Date: 2010-03-05 15:57:04 -0500 (Fri, 05 Mar 2010)
New Revision: 31967

Modified:
   labs/jbossrules/branches/factsConstraints_baunax_esteban/drools-guvnor/src/main/java/org/drools/guvnor/client/explorer/ExplorerViewCenterPanel.java
Log:
clean up

Modified: labs/jbossrules/branches/factsConstraints_baunax_esteban/drools-guvnor/src/main/java/org/drools/guvnor/client/explorer/ExplorerViewCenterPanel.java
===================================================================
--- labs/jbossrules/branches/factsConstraints_baunax_esteban/drools-guvnor/src/main/java/org/drools/guvnor/client/explorer/ExplorerViewCenterPanel.java	2010-03-05 20:54:30 UTC (rev 31966)
+++ labs/jbossrules/branches/factsConstraints_baunax_esteban/drools-guvnor/src/main/java/org/drools/guvnor/client/explorer/ExplorerViewCenterPanel.java	2010-03-05 20:57:04 UTC (rev 31967)
@@ -203,9 +203,8 @@
             this.tp.activate( tpi.getId() );
 
             return true;
-        } else {
-            return false;
-        }
+        } 
+        return false;
     }
 
     public void close(String key) {
@@ -217,73 +216,69 @@
     /**
      * Open an asset if it is not already open.
      */
-    public void openAsset(final String uuid) {
-        if ( uuid.contains( "<" ) ) {
-            return;
-        }
-        History.newItem( "asset=" + uuid ); //NON-NLS
+	public void openAsset(final String uuid) {
+		if (uuid.contains("<")) {
+			return;
+		}
+		History.newItem("asset=" + uuid); // NON-NLS
 
-        if ( !showIfOpen( uuid ) ) {
+		if (!showIfOpen(uuid)) {
 
-            final boolean[] loading = {true};
+			final boolean[] loading = { true };
 
-            Timer t = new Timer() {
-                public void run() {
-                    if ( loading[0] ) LoadingPopup.showMessage( constants.LoadingAsset() );
-                }
-            };
-            t.schedule( 200 );
+			Timer t = new Timer() {
+				public void run() {
+					if (loading[0])
+						LoadingPopup.showMessage(constants.LoadingAsset());
+				}
+			};
+			t.schedule(200);
 
-            RepositoryServiceFactory.getService().loadRuleAsset( uuid,
-                                                                 new GenericCallback<RuleAsset>() {
-                                                                     public void onSuccess(final RuleAsset a) {
-                                                                         SuggestionCompletionCache.getInstance().doAction( a.metaData.packageName,
-                                                                                                                           new Command() {
-                                                                                                                               public void execute() {
-                                                                                                                                   loading[0] = false;
-                                                                                                                                   EditItemEvent edit = new EditItemEvent() {
-                                                                                                                                       public void open(String key) {
-                                                                                                                                           openAsset( key );
-                                                                                                                                       }
+			RepositoryServiceFactory.getService().loadRuleAsset(uuid, new GenericCallback<RuleAsset>() {
+				public void onSuccess(final RuleAsset a) {
+					SuggestionCompletionCache.getInstance().doAction(a.metaData.packageName, new Command() {
+						public void execute() {
+							loading[0] = false;
+							EditItemEvent edit = new EditItemEvent() {
+								public void open(String key) {
+									openAsset(key);
+								}
 
-                                                                                                                                       public void open(MultiViewRow[] rows) {
-                                                                                                                                           for ( MultiViewRow row : rows ) {
-                                                                                                                                               openAsset( row.uuid );
-                                                                                                                                           }
-                                                                                                                                       }
-                                                                                                                                   };
-                                                                                                                                   RuleViewer rv = new RuleViewer( a,
-                                                                                                                                                                   edit );
-                                                                                                                                   addTab( a.metaData.name,
-                                                                                                                                           true,
-                                                                                                                                           rv,
-                                                                                                                                           uuid );
-                                                                                                                                   rv.setCloseCommand( new Command() {
-                                                                                                                                       public void execute() {
-                                                                                                                                           close( uuid );
-                                                                                                                                       }
-                                                                                                                                   } );
+								public void open(MultiViewRow[] rows) {
+									for (MultiViewRow row : rows) {
+										openAsset(row.uuid);
+									}
+								}
+							};
+							RuleViewer rv = new RuleViewer(a, edit);
+							addTab(a.metaData.name, true, rv, uuid);
+							rv.setCloseCommand(new Command() {
+								public void execute() {
+									close(uuid);
+								}
+							});
 
-                                                                                                                                   // When model is saved update the package view it is opened.
-                                                                                                                                   if ( a.metaData.format.equals( AssetFormats.MODEL ) ) {
-                                                                                                                                       rv.setCheckedInCommand( new Command() {
-                                                                                                                                           public void execute() {
-                                                                                                                                               PackageEditor2 packageEditor = openedPackageEditors.get( a.metaData.packageName );
-                                                                                                                                               if ( packageEditor != null ) {
-                                                                                                                                                   packageEditor.reload();
-                                                                                                                                               }
-                                                                                                                                           }
-                                                                                                                                       } );
-                                                                                                                                   }
+							// When model is saved update the package view it is
+							// opened.
+							if (a.metaData.format.equals(AssetFormats.MODEL)) {
+								rv.setCheckedInCommand(new Command() {
+									public void execute() {
+										PackageEditor2 packageEditor = openedPackageEditors.get(a.metaData.packageName);
+										if (packageEditor != null) {
+											packageEditor.reload();
+										}
+									}
+								});
+							}
 
-                                                                                                                                   LoadingPopup.close();
-                                                                                                                               }
-                                                                                                                           } );
+							LoadingPopup.close();
+						}
+					});
 
-                                                                     }
-                                                                 } );
-        }
-    }
+				}
+			});
+		}
+	}
 
     public void openAssets(MultiViewRow[] rows) {
 



More information about the jboss-svn-commits mailing list