Package org.drools.guvnor.client.rpc

Examples of org.drools.guvnor.client.rpc.RepositoryServiceAsync


                        new BackupManager() );
                break;

            case 4:
                EventLogPresenter.EventLogView eventLogView = new EventLogViewImpl();
                RepositoryServiceAsync repositoryService = RepositoryServiceFactory.getService();
                new EventLogPresenter( repositoryService,
                        eventLogView );
                tabbedPanel.addTab( constants.EventLog(),
                        eventLogView );
                break;
View Full Code Here


                                 new BackupManager() );
                break;

            case 4 :
                EventLogPresenter.EventLogView eventLogView = new EventLogViewImpl();
                RepositoryServiceAsync repositoryService = RepositoryServiceFactory.getService();
                new EventLogPresenter( repositoryService,
                                       eventLogView );
                tabbedPanel.add( constants.EventLog(),
                                 eventLogView );
                break;
View Full Code Here

        HorizontalPanel horiz = new HorizontalPanel();
        final ListBox box = new ListBox();

        LoadingPopup.showMessage( constants.PleaseWaitDotDotDot() );
        RepositoryServiceAsync repositoryService = GWT.create(RepositoryService.class);
        repositoryService.listStates(new GenericCallback<String[]>() {
            public void onSuccess(String[] list) {
                box.addItem(constants.ChooseOne());
                for (String aList : list) {
                    box.addItem(aList);
                }
View Full Code Here

                                 new BackupManager() );
                break;

            case 4 :
                EventLogPresenter.EventLogView eventLogView = new EventLogViewImpl();
                RepositoryServiceAsync repositoryService = GWT.create(RepositoryService.class);
                new EventLogPresenter( repositoryService,
                                       eventLogView );
                tabbedPanel.add( constants.EventLog(),
                                 eventLogView );
                break;
View Full Code Here

    }

    private void createWorkspace(final TextBox box) {
        LoadingPopup.showMessage( ConstantsCore.INSTANCE.CreatingStatus() );

        RepositoryServiceAsync repositoryService = GWT.create(RepositoryService.class);

        repositoryService.createWorkspace( box.getText(),
                                                           new GenericCallback<Void>() {
                                                               public void onSuccess(Void v) {

                                                                       if ( refresh != null ) {
                                                                           box.setText( "" );
View Full Code Here

        }
    }

    private void createStatus(final TextBox box) {
        LoadingPopup.showMessage( constants.CreatingStatus() );
        RepositoryServiceAsync repositoryService = GWT.create(RepositoryService.class);
        repositoryService.createState( box.getText(),
                                                           new GenericCallback<String>() {
                                                               public void onSuccess(String data) {
                                                                   if ( data != null ) {
                                                                       if ( refresh != null ) {
                                                                           box.setText( "" );
View Full Code Here

                                 new BackupManager() );
                break;

            case 4 :
                EventLogPresenter.EventLogView eventLogView = new EventLogViewImpl();
                RepositoryServiceAsync repositoryService = RepositoryServiceFactory.getService();
                new EventLogPresenter( repositoryService,
                                       eventLogView );
                tabbedPanel.add( constants.EventLog(),
                                 eventLogView );
                break;
View Full Code Here

        return btn;
    }

    private Button getCopyButton(final String snapshotName,
                                 final String packageName) {
        final RepositoryServiceAsync serv = RepositoryServiceFactory.getService();
        Button btn = new Button( constants.Copy() );
        btn.addClickListener( new ClickListener() {
            public void onClick(Widget w) {
                serv.listSnapshots( packageName,
                                    new GenericCallback<SnapshotInfo[]>() {
                                        public void onSuccess(final SnapshotInfo[] snaps) {
                                            final FormStylePopup copy = new FormStylePopup( "images/snapshot.png",
                                                                                            Format.format( constants.CopySnapshotText(),
                                                                                                           snapshotName ) );
                                            final List<RadioButton> options = new ArrayList<RadioButton>();
                                            VerticalPanel vert = new VerticalPanel();
                                            for ( int i = 0; i < snaps.length; i++ ) {
                                                RadioButton existing = new RadioButton( "snapshotNameGroup",
                                                                                        snaps[i].name ); //NON-NLS
                                                options.add( existing );
                                                vert.add( existing );
                                            }
                                           
                                HorizontalPanel newNameHorizontalPanel = new HorizontalPanel();
                                            final TextBox newNameTextBox = new TextBox();
                                        final String newNameText = constants.NEW() + ": ";

                                final RadioButton newNameRadioButton = new RadioButton( "snapshotNameGroup",
                                    newNameText);
                                newNameHorizontalPanel.add(newNameRadioButton);
                                newNameTextBox.setEnabled(false);
                                newNameRadioButton.addClickListener(new ClickListener() {
                                  public void onClick(Widget w) {
                                    newNameTextBox.setEnabled(true);
                                  }
                                });

                                newNameHorizontalPanel.add(newNameTextBox);
                                options.add(newNameRadioButton);
                                vert.add(newNameHorizontalPanel);                               

                                            copy.addAttribute(constants.ExistingSnapshots(),
                                                               vert );

                                            Button ok = new Button( constants.OK() );
                                            copy.addAttribute( "", ok );
                                            ok.addClickListener( new ClickListener() {
                                                public void onClick(Widget w) {
                                                 
                                              boolean oneButtonIsSelected = false;
                                              for ( RadioButton rb : options ) {
                                                        if ( rb.isChecked() ) {
                                                          oneButtonIsSelected = true;
                                                          break;
                                                        }
                                              }
                                            if (!oneButtonIsSelected) {
                                              Window.alert(constants.YouHaveToEnterOrChoseALabelNameForTheSnapshot());
                                              return;
                                            }
                                           
                                           
                                                    if ( newNameRadioButton.isChecked() ) {
                                                        if ( checkUnique( snaps,
                                                                          newNameTextBox.getText() ) ) {
                                                            serv.copyOrRemoveSnapshot( packageName,
                                                                                       snapshotName,
                                                                                       false,
                                                                                       newNameTextBox.getText(),
                                                                                       new GenericCallback() {
                                                                                           public void onSuccess(Object data) {
                                                                                               copy.hide();
                                                                                               Window.alert( Format.format( constants.CreatedSnapshot0ForPackage1(),
                                                                                                                            newNameTextBox.getText(),
                                                                                                                            packageName ) );
                                                                                           }
                                                                                       } );
                                                        }
                                                    } else {
                                                        for ( RadioButton rb : options ) {
                                                            if ( rb.isChecked() ) {
                                                                final String newName = rb.getText();
                                                                serv.copyOrRemoveSnapshot( packageName,
                                                                                           snapshotName,
                                                                                           false,
                                                                                           newName,
                                                                                           new GenericCallback() {
                                                                                               public void onSuccess(Object data) {
View Full Code Here

        return btn;
    }

    private Button getCopyButton(final String snapshotName,
                                 final String packageName) {
        final RepositoryServiceAsync serv = RepositoryServiceFactory.getService();
        Button btn = new Button( constants.Copy() );
        btn.addClickListener( new ClickListener() {
            public void onClick(Widget w) {
                serv.listSnapshots( packageName,
                                    new GenericCallback<SnapshotInfo[]>() {
                                        public void onSuccess(final SnapshotInfo[] snaps) {
                                            final FormStylePopup copy = new FormStylePopup( "images/snapshot.png",
                                                                                            Format.format( constants.CopySnapshotText(),
                                                                                                           snapshotName ) );
                                            final List<RadioButton> options = new ArrayList<RadioButton>();
                                            VerticalPanel vert = new VerticalPanel();
                                            for ( int i = 0; i < snaps.length; i++ ) {
                                                RadioButton existing = new RadioButton( "snapshotNameGroup",
                                                                                        snaps[i].name ); //NON-NLS
                                                options.add( existing );
                                                vert.add( existing );
                                            }
                                           
                                HorizontalPanel newNameHorizontalPanel = new HorizontalPanel();
                                            final TextBox newNameTextBox = new TextBox();
                                        final String newNameText = constants.NEW() + ": ";

                                final RadioButton newNameRadioButton = new RadioButton( "snapshotNameGroup",
                                    newNameText);
                                newNameHorizontalPanel.add(newNameRadioButton);
                                newNameTextBox.setEnabled(false);
                                newNameRadioButton.addClickListener(new ClickListener() {
                                  public void onClick(Widget w) {
                                    newNameTextBox.setEnabled(true);
                                  }
                                });

                                newNameHorizontalPanel.add(newNameTextBox);
                                options.add(newNameRadioButton);
                                vert.add(newNameHorizontalPanel);                               

                                            copy.addAttribute(constants.ExistingSnapshots(),
                                                               vert );

                                            Button ok = new Button( constants.OK() );
                                            copy.addAttribute( "", ok );
                                            ok.addClickListener( new ClickListener() {
                                                public void onClick(Widget w) {
                                                 
                                              boolean oneButtonIsSelected = false;
                                              for ( RadioButton rb : options ) {
                                                        if ( rb.isChecked() ) {
                                                          oneButtonIsSelected = true;
                                                          break;
                                                        }
                                              }
                                            if (!oneButtonIsSelected) {
                                              Window.alert(constants.YouHaveToEnterOrChoseALabelNameForTheSnapshot());
                                              return;
                                            }
                                           
                                           
                                                    if ( newNameRadioButton.isChecked() ) {
                                                        if ( checkUnique( snaps,
                                                                          newNameTextBox.getText() ) ) {
                                                            serv.copyOrRemoveSnapshot( packageName,
                                                                                       snapshotName,
                                                                                       false,
                                                                                       newNameTextBox.getText(),
                                                                                       new GenericCallback() {
                                                                                           public void onSuccess(Object data) {
                                                                                               copy.hide();
                                                                                               Window.alert( Format.format( constants.CreatedSnapshot0ForPackage1(),
                                                                                                                            newNameTextBox.getText(),
                                                                                                                            packageName ) );
                                                                                           }
                                                                                       } );
                                                        }
                                                    } else {
                                                        for ( RadioButton rb : options ) {
                                                            if ( rb.isChecked() ) {
                                                                final String newName = rb.getText();
                                                                serv.copyOrRemoveSnapshot( packageName,
                                                                                           snapshotName,
                                                                                           false,
                                                                                           newName,
                                                                                           new GenericCallback() {
                                                                                               public void onSuccess(Object data) {
View Full Code Here

        //if we have to do it lazy, we will hit up the server when the widget gets focus
        if ( dropData != null && dropData.fixedList == null && dropData.queryExpression != null ) {
            Scheduler.get().scheduleDeferred( new Command() {
                public void execute() {
                    LoadingPopup.showMessage( Constants.INSTANCE.RefreshingList() );
                    RepositoryServiceAsync repositoryService = GWT.create( RepositoryService.class );
                    repositoryService.loadDropDownExpression( dropData.valuePairs,
                                                              dropData.queryExpression,
                                                              new GenericCallback<String[]>() {
                                                                  public void onSuccess(String[] data) {
                                                                      LoadingPopup.close();
View Full Code Here

TOP

Related Classes of org.drools.guvnor.client.rpc.RepositoryServiceAsync

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.