Package org.drools.guvnor.client.common

Examples of org.drools.guvnor.client.common.PrettyFormLayout


                        EditItemEvent edit) {
        this.layout = new VerticalPanel();
        this.packageUUID = packageUUID;
        this.edit = edit;

        PrettyFormLayout pf = new PrettyFormLayout();

        VerticalPanel vert = new VerticalPanel();
        String m = Format.format( constants.AnalysingPackage(),
                                  new String[]{packageName} );
        vert.add( new HTML( m ) );
        Button run = new Button( constants.RunAnalysis() );
        run.addClickListener( new ClickListener() {
            public void onClick(Widget w) {
                runAnalysis();
            }
        } );
        vert.add( run );

        pf.addHeader( "images/analyse_large.png",
                      vert );
        layout.add( pf );

        layout.add( new Label() );
View Full Code Here


        VerticalPanel vert = new VerticalPanel();
        this.snapInfo = snapInfo;
        this.parentConf = parentPackage;
        this.close = closeSnap;
        PrettyFormLayout head = new PrettyFormLayout();

        head.addHeader( "images/snapshot.png",
                        header() );

        this.centerPanel = center;

        vert.add( head );
View Full Code Here

    private ListBox currentStatuses;
    private Constants constants = ((Constants) GWT.create(Constants.class));

    public StateManager() {
        PrettyFormLayout form = new PrettyFormLayout();
        form.addHeader( "images/status_large.png",
                        new HTML( "<b>" + constants.ManageStatuses() + "</b>" ) );
        form.startSection(constants.StatusTagsAreForTheLifecycleOfAnAsset());

        currentStatuses = new ListBox();
        currentStatuses.setVisibleItemCount( 7 );
        currentStatuses.setWidth( "50%" );

        refreshList();

        form.addAttribute(constants.CurrentStatuses(),
                           currentStatuses );

        HorizontalPanel hPanel = new HorizontalPanel();
        Button create = new Button(constants.NewStatus());
        create.setTitle(constants.CreateANewCategory());
        create.addClickListener( new ClickListener() {
            public void onClick(Widget w) {
                StatusEditor newCat = new StatusEditor( new Command() {
                    public void execute() {
                        refreshList();
                    }
                } );

                newCat.show();
            }
        } );

        Button edit = new Button(constants.RenameSelected());
        edit.addClickListener( new ClickListener() {
            public void onClick(Widget w) {

                if ( !currentStatuses.isItemSelected( currentStatuses.getSelectedIndex() ) ) {
                    Window.alert(constants.PleaseSelectAStatusToRename());
                    return;
                }
                renameSelected();

            }
        } );

        Button remove = new Button(constants.DeleteSelected());
        remove.addClickListener( new ClickListener() {
            public void onClick(Widget w) {

                if ( !currentStatuses.isItemSelected( currentStatuses.getSelectedIndex() ) ) {
                    Window.alert(constants.PleaseSelectAStatusToRemove());
                    return;
                }

                removeStatus();

            }

        } );
        hPanel.add( create );
        hPanel.add( edit );
        hPanel.add( remove );

        form.addAttribute(constants.AddNewStatus(),
                           hPanel );

        form.endSection();
        initWidget( form );
    }
View Full Code Here

    private Constants constants = GWT.create(Constants.class);

    public ArchivedAssetManager(final ExplorerViewCenterPanel tab) {


        PrettyFormLayout pf = new PrettyFormLayout();

        VerticalPanel header = new VerticalPanel();
        header.add(new HTML(constants.ArchivedItems()));

        pf.addHeader("images/backup_large.png", header); //NON-NLS




        EditItemEvent edit = new EditItemEvent () {
            public void open(String key) {
              tab.openAsset(key);
            }

            public void open(MultiViewRow[] rows) {
                for ( MultiViewRow row : rows ) {
                    tab.openAsset( row.uuid );
                }
            }
        };
        grid = new AssetItemGrid(edit, AssetItemGrid.ARCHIVED_RULE_LIST_TABLE_ID, new AssetItemGridDataLoader() {
      public void loadData(int startRow, int numberOfRows,
          GenericCallback cb) {
        RepositoryServiceFactory.getService().loadArchivedAssets(startRow, numberOfRows, cb);
      }
        });


        loadPackages();
        Toolbar tb = new Toolbar();
        final ToolbarButton restorePackage = new ToolbarButton();
        restorePackage.addListener(new ButtonListenerAdapter() {
              public void onClick(
                  com.gwtext.client.widgets.Button button,
                  EventObject e) {
                restorePackage(packages.getValue(packages.getSelectedIndex()));
              }

            });
        restorePackage.setText(constants.RestoreSelectedPackage());
        tb.addButton(restorePackage);




        final ToolbarButton delPackage = new ToolbarButton();
        delPackage.setText(constants.PermanentlyDeletePackage());
        delPackage.addListener(new ButtonListenerAdapter() {
              public void onClick(
                  com.gwtext.client.widgets.Button button,
                  EventObject e) {
                if (Window.confirm(constants.AreYouSurePackageDelete())) {
                  deletePackage(packages.getValue(packages.getSelectedIndex()));
                }
              }
        });
        tb.addButton(delPackage);



        pf.startSection(constants.ArchivedPackagesList());

        pf.addRow(tb);
        pf.addRow(packages);


        pf.endSection();

        tb = new Toolbar();
        final ToolbarButton restoreAsset = new ToolbarButton();
        restoreAsset.setText(constants.RestoreSelectedAsset());
        tb.addButton(restoreAsset);
        restoreAsset.addListener(new ButtonListenerAdapter() {
              public void onClick(com.gwtext.client.widgets.Button button, EventObject e) {
                      if (grid.getSelectedRowUUIDs() == null) {
                        Window.alert(constants.PleaseSelectAnItemToRestore());
                        return;
                      }
                        RepositoryServiceFactory.getService().archiveAssets( grid.getSelectedRowUUIDs(), false, new GenericCallback() {
                            public void onSuccess(Object arg0) {
                                Window.alert(constants.ItemRestored());
                                grid.refreshGrid();
                            }
                        });
              };
        });


        final ToolbarButton deleteAsset = new ToolbarButton();
        deleteAsset.setText(constants.DeleteSelectedAsset());
        tb.addButton(deleteAsset);

        deleteAsset.addListener(
            new ButtonListenerAdapter() {
              public void onClick(
                  com.gwtext.client.widgets.Button button,
                  EventObject e) {
                      if (grid.getSelectedRowUUIDs() == null) {
                        Window.alert(constants.PleaseSelectAnItemToPermanentlyDelete());
                        return;
                      }
                      if (!Window.confirm(constants.AreYouSureDeletingAsset())) {
                        return;
                      }
                        RepositoryServiceFactory.getService().removeAssets( grid.getSelectedRowUUIDs(), new GenericCallback() {

                            public void onSuccess(Object arg0) {
                                Window.alert(constants.ItemDeleted());
                                grid.refreshGrid();
                            }
                        });
              }
            });

        pf.startSection(constants.ArchivedAssets());
        pf.addRow(tb);

        pf.addRow(grid);

        pf.endSection();


        initWidget( pf );
    }
View Full Code Here

        layout = new VerticalPanel();

        setupDecisionTable();

        configureColumnsNote = new PrettyFormLayout();
        configureColumnsNote.startSection();
        configureColumnsNote.addRow( new HTML( AbstractImagePrototype.create( DroolsGuvnorImageResources.INSTANCE.information() ).getHTML()
                                               + "&nbsp;"
                                               + Constants.INSTANCE.ConfigureColumnsNote() ) );
        configureColumnsNote.endSection();
View Full Code Here

    private ListBox       availableWorkspacesListBox;
    private ListBox       availableModulesListBox = new ListBox( true );
    private ListBox       selectedModulesListBox = new ListBox( true );

    public WorkspaceManager() {
        PrettyFormLayout form = new PrettyFormLayout();
        form.addHeader( images.statusLarge(),
                        new HTML( "<b>" + constants.ManageWorkspaces() + "</b>" ) );
        form.startSection( constants.Workspaces() );

        form.addAttribute("", buildDoubleList());

        HorizontalPanel hPanel = new HorizontalPanel();
        Button create = new Button( constants.AddWorkspace() );
        create.addClickHandler( new ClickHandler() {
            public void onClick(ClickEvent w) {
                WorkspaceEditor newCat = new WorkspaceEditor( new Command() {
                    public void execute() {
                        refreshWorkspaceList();
                    }
                } );

                newCat.show();
            }
        } );

        Button remove = new Button( constants.DeleteSelectedWorkspace() );
        remove.addClickHandler( new ClickHandler() {
            public void onClick(ClickEvent w) {
                if ( availableWorkspacesListBox.getSelectedIndex() == -1 ) {
                    Window.alert( constants.PleaseSelectAWorkspaceToRemove() );
                    return;
                }
                removeWorkspace();
            }

        } );
       
        Button updateWorkspace = new Button(constants.UpdateSelectedWorkspace());
        updateWorkspace.addClickHandler( new ClickHandler() {
            public void onClick(ClickEvent w) {
                if ( availableWorkspacesListBox.getSelectedIndex() == -1 ) {
                    Window.alert( constants.PleaseSelectAWorkspaceToUpdate() );
                    return;
                }
               
                updateWorkspace();
            }

        } );
        hPanel.add( create );
        hPanel.add( remove );
        hPanel.add( updateWorkspace );

        form.addAttribute( "",
                           hPanel );

        form.endSection();
        initWidget( form );
    }
View Full Code Here

    public ArchivedAssetManager(ClientFactory clientFactory,
                                EventBus eventBus) {

        this.eventBus = eventBus;

        PrettyFormLayout pf = new PrettyFormLayout();

        VerticalPanel header = new VerticalPanel();
        header.add( new HTML( constants.ArchivedItems() ) );

        pf.addHeader( images.backupLarge(),
                      header );

        loadPackages();

        Command restoreSelectedAssetCommand = new Command() {

            public void execute() {
                if ( table.getSelectedRowUUIDs() == null ) {
                    Window.alert( constants.PleaseSelectAnItemToRestore() );
                    return;
                }
                RepositoryServiceFactory.getAssetService().archiveAssets( table.getSelectedRowUUIDs(),
                                                                          false,
                                                                          new GenericCallback<java.lang.Void>() {
                                                                              public void onSuccess(Void arg0) {
                                                                                  Window.alert( constants.ItemRestored() );
                                                                                  table.refresh();
                                                                              }
                                                                          } );
            }

        };

        Command deleteSelectedAssetCommand = new Command() {

            public void execute() {
                if ( table.getSelectedRowUUIDs() == null ) {
                    Window.alert( constants.PleaseSelectAnItemToPermanentlyDelete() );
                    return;
                }
                if ( !Window.confirm( constants.AreYouSureDeletingAsset() ) ) {
                    return;
                }
                RepositoryServiceFactory.getAssetService().removeAssets( table.getSelectedRowUUIDs(),
                                                                         new GenericCallback<java.lang.Void>() {
                                                                             public void onSuccess(Void arg0) {
                                                                                 Window.alert( constants.ItemDeleted() );
                                                                                 table.refresh();
                                                                             }
                                                                         } );
            }

        };

        table = new AdminArchivedPagedTable(
                                             restoreSelectedAssetCommand,
                                             deleteSelectedAssetCommand,
                                             clientFactory );
        HorizontalPanel packagesToolbar = new HorizontalPanel();
        btnRestorePackage = new Button( constants.RestoreSelectedPackage() );
        btnRestorePackage.addClickHandler( new ClickHandler() {

            public void onClick(ClickEvent event) {
                if ( packages.getSelectedIndex() == -1 ) {
                    Window.alert( constants.PleaseSelectAnItemToRestore() );
                    return;
                }
                restorePackage( packages.getValue( packages.getSelectedIndex() ) );
            }

        } );
        packagesToolbar.add( btnRestorePackage );

        btnDeletePackage = new Button( constants.PermanentlyDeletePackage() );
        btnDeletePackage.addClickHandler( new ClickHandler() {

            public void onClick(ClickEvent event) {
                if ( packages.getSelectedIndex() == -1 ) {
                    Window.alert( constants.PleaseSelectAnItemToPermanentlyDelete() );
                    return;
                }
                if ( Window.confirm( constants.AreYouSurePackageDelete() ) ) {
                    deletePackage( packages.getValue( packages.getSelectedIndex() ) );
                }
            }

        } );
        packagesToolbar.add( btnDeletePackage );

        pf.startSection( constants.ArchivedPackagesList() );
        pf.addRow( packagesToolbar );
        pf.addRow( packages );
        pf.endSection();

        pf.startSection( constants.ArchivedAssets() );
        pf.addRow( table );
        pf.endSection();

        initWidget( pf );
    }
View Full Code Here

        layout = new VerticalPanel();

        setupDecisionTable();

        configureColumnsNote = new PrettyFormLayout();
        configureColumnsNote.startSection();
        configureColumnsNote.addRow( new HTML( AbstractImagePrototype.create( DroolsGuvnorImages.INSTANCE.information() ).getHTML()
                                               + "&nbsp;"
                                               + Constants.INSTANCE.ConfigureColumnsNote() ) );
        configureColumnsNote.endSection();
View Full Code Here

                Arrays.asList( new String[]{AssetFormats.TEST_SCENARIO} ),
                null,
                clientFactory );

        layout.setWidth( "100%" );
        PrettyFormLayout pf = new PrettyFormLayout();

        VerticalPanel vert = new VerticalPanel();
        vert.add( new HTML( "<b>" + Constants.INSTANCE.ScenariosForPackage1() + "</b>" + packageName ) );
        Button run = new Button( Constants.INSTANCE.RunAllScenarios() );
        run.addClickHandler( new ClickHandler() {
            public void onClick(ClickEvent event) {
                runAllScenarios( packageUUID );
            }
        } );

        vert.add( run );

        pf.addHeader( DroolsGuvnorImages.INSTANCE.scenarioLarge(),
                vert );

        layout.add( pf );
        layout.add( this.table );
View Full Code Here

    public VerticalPanel  layout    = new VerticalPanel();

    public RuleVerifierManager() {

        PrettyFormLayout form = new PrettyFormLayout();
        form.addHeader( DroolsGuvnorImages.INSTANCE.ruleVerification(),
                        new HTML( Constants.INSTANCE.EditRulesVerificationConfiguration() ) );
        form.startSection( Constants.INSTANCE.AutomaticVerification() );

        final CheckBox enableOnlineValidator = new CheckBox();
        enableOnlineValidator.setValue( WorkingSetManager.getInstance().isAutoVerifierEnabled() );
        form.addAttribute( Constants.INSTANCE.Enabled(),
                           enableOnlineValidator );

        HorizontalPanel actions = new HorizontalPanel();

        form.addAttribute( "",
                           actions );

        Button btnSave = new Button( Constants.INSTANCE.SaveChanges() );
        btnSave.setTitle( Constants.INSTANCE.SaveAllChanges() );
        btnSave.addClickHandler( new ClickHandler() {
            public void onClick(ClickEvent event) {
                WorkingSetManager.getInstance().setAutoVerifierEnabled( enableOnlineValidator.getValue() );
                Window.alert( Constants.INSTANCE.AllChangesHaveBeenSaved() );
            }
        } );

        actions.add( btnSave );

        form.endSection();

        initWidget( form );

    }
View Full Code Here

TOP

Related Classes of org.drools.guvnor.client.common.PrettyFormLayout

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.