Package org.drools.guvnor.client.rpc

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


      public void onExpandNode(final TreeNode node) {
        if (node.getId().equals("snapshotRoot")) { // NON-NLS
          return;
        }
        final PackageConfigData conf = (PackageConfigData) node.getUserObject();
        if (conf != null) {
          RepositoryServiceFactory.getService().listSnapshots(conf.name,
              new GenericCallback<SnapshotInfo[]>() {
                public void onSuccess(SnapshotInfo[] snaps) {
                  for (final SnapshotInfo snapInfo : snaps) {
                    TreeNode snap = new TreeNode();
                    snap.setTooltip(snapInfo.comment);
                    snap.setText(snapInfo.name);
                    snap.setUserObject(new Object[] { snapInfo, conf });
                    node.appendChild(snap);
                  }
                  node.removeChild(node.getFirstChild());
                }
              });
        }
      }

            public void onClick(TreeNode node, EventObject e) {

                if (node.getUserObject() instanceof Object[]) {
//                  Node[] children = node.getParentNode().getChildNodes();
//                  for(Node n : children) {
//                    n.remove();
//                  }
                    Object[] o = (Object[]) node.getUserObject();
                    final String snapName = ((SnapshotInfo) o[0]).name;
                    PackageConfigData conf = (PackageConfigData) o[1];
                    RepositoryServiceFactory.getService().listSnapshots(conf.name, new GenericCallback<SnapshotInfo[]>() {
                        public void onSuccess(SnapshotInfo[] a) {
                            for(SnapshotInfo snap : a) {
                              if (snap.name.equals(snapName)) {
                                centertabbedPanel.openSnapshot(snap);
View Full Code Here


            public void onExpand(Node node) {

                RepositoryServiceFactory.getService().listPackages( new GenericCallback<PackageConfigData[]>() {
                    public void onSuccess(PackageConfigData[] conf) {
                        for ( int i = 0; i < conf.length; i++ ) {
                            final PackageConfigData c = conf[i];
                            TreeNode pkg = new TreeNode();
                            pkg.setText( c.name );
                            pkg.setIcon( "images/package.gif" ); //NON-NLS

                            scenarios.appendChild( pkg );
                            pkg.addListener( new TreeNodeListenerAdapter() {
                                public void onClick(Node node,
                                                    EventObject e) {
                                    if ( !centerPanel.showIfOpen( "scenarios" + c.uuid ) ) { //NON-NLS
                                        String m = Format.format( constants.ScenariosForPackage(),
                                                                  c.name );
                                        centerPanel.addTab( m,
                                                            true,
                                                            new ScenarioPackageView( c.uuid,
                                                                                     c.name,
                                                                                     edit,
                                                                                     centerPanel ),
                                                            "scenarios" + c.uuid ); //NON-NLS
                                    }
                                }
                            } );
                        }
                        scenarios.removeChild( scenarios.getFirstChild() );

                    }
                } );
            }

            public void onCollapse(Node node) {
                Node[] cs = node.getChildNodes();
                for ( int i = 0; i < cs.length; i++ ) {
                    node.removeChild( cs[i] );
                }
                node.appendChild( new TreeNode( constants.PleaseWaitDotDotDot() ) );
            }
        } );

        analysis.addListener( new TreeNodeListenerAdapter() {

            public void onExpand(Node node) {
                RepositoryServiceFactory.getService().listPackages( new GenericCallback<PackageConfigData[]>() {
                    public void onSuccess(PackageConfigData[] conf) {

                        for ( int i = 0; i < conf.length; i++ ) {
                            final PackageConfigData c = conf[i];
                            TreeNode pkg = new TreeNode();
                            pkg.setText( c.name );
                            pkg.setIcon( "images/package.gif" ); //NON-NLS

                            analysis.appendChild( pkg );
View Full Code Here

        repositoryPackageOperations.setRulesRepository( rulesRepository );
    }

    @Test
    public void testPackageNameSorting() {
        PackageConfigData c1 = new PackageConfigData( "org.foo" );
        PackageConfigData c2 = new PackageConfigData( "org.foo.bar" );

        List<PackageConfigData> ls = new ArrayList<PackageConfigData>();
        ls.add( c2 );
        ls.add( c1 );
        this.repositoryPackageOperations.sortPackages( ls );
View Full Code Here

    @Test
    public void testSavePackageArhived() throws SerializationException {
        RepositoryPackageOperations localRepositoryPackageOperations = initSpyingOnRealRepositoryPackageOperations();

        PackageConfigData packageConfigData = createPackageConfigData( false );
        PackageItem packageItem = mock( PackageItem.class );
        Calendar calendar = GregorianCalendar.getInstance();
        when( packageItem.getLastModified() ).thenReturn( calendar );
        initDroolsHeaderCheck( packageItem );
        when( packageItem.isArchived() ).thenReturn( true );
View Full Code Here

                navigationViewFactory.getModuleTreeItemView()
        ).thenReturn(
                view
        );

        PackageConfigData packageConfigData = mock( PackageConfigData.class );
        when(
                packageConfigData.getUuid()
        ).thenReturn(
                "mockUuid"
        );
        new ModuleTreeSelectableItem( clientFactory, treeItem, packageConfigData );
View Full Code Here

    @Test
    public void testAddModules() throws Exception {

        ArrayList<PackageConfigData> firstLevelDatas = new ArrayList<PackageConfigData>();
        firstLevelDatas.add( new PackageConfigData( "defaultPackage" ) );
        PackageConfigData mortgageConfigData = new PackageConfigData( "mortgage" );

        ArrayList<PackageConfigData> secondLevelDatas = new ArrayList<PackageConfigData>();
        secondLevelDatas.add( new PackageConfigData( "sub1" ) );

        PackageConfigData thirdLevelConfigDataParent = new PackageConfigData( "sub2" );
        secondLevelDatas.add( thirdLevelConfigDataParent );

        ArrayList<PackageConfigData> thirdLevelDatas = new ArrayList<PackageConfigData>();
        thirdLevelDatas.add( new PackageConfigData( "level3" ) );

        thirdLevelConfigDataParent.setSubPackages( thirdLevelDatas.toArray( new PackageConfigData[thirdLevelDatas.size()] ) );
        secondLevelDatas.add( new PackageConfigData( "sub3" ) );

        mortgageConfigData.setSubPackages( secondLevelDatas.toArray( new PackageConfigData[secondLevelDatas.size()] ) );
        firstLevelDatas.add( mortgageConfigData );

        packageConfigDatas = firstLevelDatas.toArray( new PackageConfigData[firstLevelDatas.size()] );
View Full Code Here

    @Test
    public void testOpenFormatsPlace() throws Exception {

        setUpPresenter();

        PackageConfigData packageConfigData = new PackageConfigData( "default" );
        packageConfigData.setUuid( "defaultUuid" );

        presenter.onModuleSelected(
                new ModuleFormatsGridPlace(
                                       packageConfigData,
                                       "Rules",
View Full Code Here

                                                    "newName" );
    }

    private IsTreeItem setUpDefaultModule(String moduleName) {
        ArrayList<PackageConfigData> firstLevelDatas = new ArrayList<PackageConfigData>();
        PackageConfigData mortgageConfigData = new PackageConfigData( moduleName );
        mortgageConfigData.setUuid( "defaultUuid" );
        firstLevelDatas.add( mortgageConfigData );
        packageConfigDatas = firstLevelDatas.toArray( new PackageConfigData[firstLevelDatas.size()] );

        IsTreeItem defaultRootTreeItem = mock( IsTreeItem.class );
        when(
View Full Code Here

      public void onExpandNode(final TreeNode node) {
        if (node.getId().equals("snapshotRoot")) { // NON-NLS
          return;
        }
        final PackageConfigData conf = (PackageConfigData) node.getUserObject();
        if (conf != null) {
          RepositoryServiceFactory.getService().listSnapshots(conf.name,
              new GenericCallback<SnapshotInfo[]>() {
                public void onSuccess(SnapshotInfo[] snaps) {
                  for (final SnapshotInfo snapInfo : snaps) {
                    TreeNode snap = new TreeNode();
                    snap.setTooltip(snapInfo.comment);
                    snap.setText(snapInfo.name);
                    snap.setUserObject(new Object[] { snapInfo, conf });
                    node.appendChild(snap);
                  }
                  node.removeChild(node.getFirstChild());
                }
              });
        }
      }

            public void onClick(TreeNode node, EventObject e) {

                if (node.getUserObject() instanceof Object[]) {
//                  Node[] children = node.getParentNode().getChildNodes();
//                  for(Node n : children) {
//                    n.remove();
//                  }
                    Object[] o = (Object[]) node.getUserObject();
                    final String snapName = ((SnapshotInfo) o[0]).name;
                    PackageConfigData conf = (PackageConfigData) o[1];
                    RepositoryServiceFactory.getService().listSnapshots(conf.name, new GenericCallback<SnapshotInfo[]>() {
                        public void onSuccess(SnapshotInfo[] a) {
                            for(SnapshotInfo snap : a) {
                              if (snap.name.equals(snapName)) {
                                centertabbedPanel.openSnapshot(snap);
View Full Code Here

        return listPackages( true,
                             pf );
    }

    public PackageConfigData loadGlobalPackage() {
        PackageConfigData data = new PackageConfigData();
        PackageItem item = repository.loadGlobalArea();

        data.uuid = item.getUUID();
        data.header = getDroolsHeader( item );
        data.externalURI = item.getExternalURI();
View Full Code Here

TOP

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

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.