[jboss-svn-commits] JBL Code SVN: r32158 - in labs/jbossrules/branches/factsConstraints_baunax_esteban/drools-guvnor/src/main/java/org/drools/guvnor/client: packages and 1 other directory.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Fri Mar 19 16:15:54 EDT 2010
Author: baunax
Date: 2010-03-19 16:15:54 -0400 (Fri, 19 Mar 2010)
New Revision: 32158
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/packages/PackageEditor2.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-19 20:13:50 UTC (rev 32157)
+++ labs/jbossrules/branches/factsConstraints_baunax_esteban/drools-guvnor/src/main/java/org/drools/guvnor/client/explorer/ExplorerViewCenterPanel.java 2010-03-19 20:15:54 UTC (rev 32158)
@@ -333,41 +333,33 @@
/**
* Open a package editor if it is not already open.
*/
- public void openPackageEditor(final String uuid,
- final Command refPackageList) {
+ public void openPackageEditor(final String uuid, final Command refPackageList) {
- if ( !showIfOpen( uuid ) ) {
- LoadingPopup.showMessage( constants.LoadingPackageInformation() );
- RepositoryServiceFactory.getService().loadPackageConfig( uuid,
- new GenericCallback<PackageConfigData>() {
- public void onSuccess(PackageConfigData conf) {
- PackageEditor2 ed = new PackageEditor2( conf,
- new Command() {
- public void execute() {
- close( uuid );
- }
- },
- refPackageList,
- new EditItemEvent() {
- public void open(String uuid) {
- openAsset( uuid );
- }
+ if (!showIfOpen(uuid)) {
+ LoadingPopup.showMessage(constants.LoadingPackageInformation());
+ RepositoryServiceFactory.getService().loadPackageConfig(uuid, new GenericCallback<PackageConfigData>() {
+ public void onSuccess(PackageConfigData conf) {
+ PackageEditor2 ed = new PackageEditor2(conf, new Command() {
+ public void execute() {
+ close(uuid);
+ }
+ }, refPackageList, new EditItemEvent() {
+ public void open(String uuid) {
+ openAsset(uuid);
+ }
- public void open(MultiViewRow[] rows) {
- for ( MultiViewRow row : rows ) {
- openAsset( row.uuid );
- }
- }
- } );
- addTab( conf.name,
- true,
- ed,
- conf.uuid );
- LoadingPopup.close();
- }
- } );
- }
- }
+ public void open(MultiViewRow[] rows) {
+ for (MultiViewRow row : rows) {
+ openAsset(row.uuid);
+ }
+ }
+ });
+ addTab(conf.name, true, ed, conf.uuid);
+ LoadingPopup.close();
+ }
+ });
+ }
+ }
public void openFind() {
if ( !showIfOpen( "FIND" ) ) { //NON-NLS
Modified: labs/jbossrules/branches/factsConstraints_baunax_esteban/drools-guvnor/src/main/java/org/drools/guvnor/client/packages/PackageEditor2.java
===================================================================
--- labs/jbossrules/branches/factsConstraints_baunax_esteban/drools-guvnor/src/main/java/org/drools/guvnor/client/packages/PackageEditor2.java 2010-03-19 20:13:50 UTC (rev 32157)
+++ labs/jbossrules/branches/factsConstraints_baunax_esteban/drools-guvnor/src/main/java/org/drools/guvnor/client/packages/PackageEditor2.java 2010-03-19 20:15:54 UTC (rev 32158)
@@ -64,9 +64,6 @@
* @author Michael Neale
*/
public class PackageEditor2 extends PrettyFormLayout {
-
-
-
private PackageConfigData conf;
private HTML status;
protected ValidatedResponse previousResponse;
@@ -112,11 +109,6 @@
addAttribute(constants.CategoryRules(), getAddCatRules() );
addAttribute( "", getShowCatRules() );
-
-
-
-
-
if (!conf.isSnapshot) {
Button save = new Button(constants.SaveAndValidateConfiguration());
save.addClickListener( new ClickListener() {
@@ -262,14 +254,12 @@
}
}
+
protected void showCatRuleSelector(Widget w) {
final FormStylePopup pop = new FormStylePopup("images/config.png", constants.AddACategoryRuleToThePackage()); //NON-NLS
final Button addbutton = new Button(constants.OK());
final TextBox ruleName = new TextBox();
-
-
-
final CategoryExplorerWidget exw = new CategoryExplorerWidget(new CategorySelectHandler(){
public void selected(String selectedPath) { //not needed
}
@@ -296,7 +286,6 @@
pop.show();
}
-
private String getDateString(Date d) {
if (d != null)
return d.toLocaleString();
@@ -430,8 +419,6 @@
return horiz;
}
-
-
private void showRenameDialog() {
final FormStylePopup pop = new FormStylePopup("images/new_wiz.gif", constants.RenameThePackage());
pop.addRow( new HTML(constants.RenamePackageTip()) );
@@ -442,8 +429,8 @@
ok.addClickListener( new ClickListener() {
public void onClick(Widget w) {
- RepositoryServiceFactory.getService().renamePackage( conf.uuid, name.getText(), new GenericCallback() {
- public void onSuccess(Object data) {
+ RepositoryServiceFactory.getService().renamePackage( conf.uuid, name.getText(), new GenericCallback<String>() {
+ public void onSuccess(String data) {
refreshPackageList.execute();
conf.name = name.getText();
refreshWidgets();
@@ -457,8 +444,6 @@
pop.show();
}
-
-
/**
* Will show a copy dialog for copying the whole package.
*/
@@ -477,8 +462,8 @@
return;
}
LoadingPopup.showMessage(constants.PleaseWaitDotDotDot());
- RepositoryServiceFactory.getService().copyPackage( conf.name, name.getText(), new GenericCallback() {
- public void onSuccess(Object data) {
+ RepositoryServiceFactory.getService().copyPackage( conf.name, name.getText(), new GenericCallback<Void>() {
+ public void onSuccess(Void data) {
refreshPackageList.execute();
Window.alert(constants.PackageCopiedSuccessfully());
pop.hide();
@@ -492,18 +477,12 @@
}
- protected void doCopyPackage(String name) {
-
- }
-
private void doSaveAction(final Command refresh) {
LoadingPopup.showMessage(constants.SavingPackageConfigurationPleaseWait());
- RepositoryServiceFactory.getService().savePackage( this.conf, new GenericCallback() {
- public void onSuccess(Object data) {
-
- previousResponse = (ValidatedResponse) data;
-
+ RepositoryServiceFactory.getService().savePackage( this.conf, new GenericCallback<ValidatedResponse>() {
+ public void onSuccess(ValidatedResponse data) {
+ previousResponse = data;
reload();
LoadingPopup.showMessage(constants.PackageConfigurationUpdatedSuccessfullyRefreshingContentCache());
@@ -515,17 +494,10 @@
LoadingPopup.close();
}
});
-
-
-
-
}
});
-
}
-
-
/**
* Will refresh all the data.
*/
More information about the jboss-svn-commits
mailing list