Package org.drools.guvnor.shared.modules.ModuleHeader

Examples of org.drools.guvnor.shared.modules.ModuleHeader.Global


                        if ( tk.endsWith( ";" ) ) {
                            tk = tk.substring( 0,
                                               tk.length() - 1 );
                        }
                        String[] gt = tk.split( "\\s+" );
                        mh.getGlobals().add( new Global( gt[0],
                                                         gt[1] ) );
                    } else if ( tk.startsWith( "rule" ) ) {
                        mh.setHasRules( true );
                        return mh;
                    } else if ( tk.startsWith( "declare" ) ) {
View Full Code Here


            Import i = iterator.next();
            sb.append( "import " + i.getType() + "\n" );
        }

        for ( Iterator<Global> it = mh.getGlobals().iterator(); it.hasNext(); ) {
            Global g = (Global) it.next();
            sb.append( "global " + g.getType() + " " + g.getName() );
            if ( it.hasNext() ) {
                sb.append( '\n' );
            }
        }
        return sb.toString();
View Full Code Here

        assertEquals( 3,
                      mh.getGlobals().size() );
        assertEquals( 0,
                      mh.getImports().size() );

        Global i = mh.getGlobals().get( 0 );
        assertEquals( "goo.bar.Whee",
                      i.getType() );
        assertEquals( "x",
                      i.getName() );

        i = mh.getGlobals().get( 1 );
        assertEquals( "wee.waah.Foo",
                      i.getType() );
        assertEquals( "asd",
                      i.getName() );

        i = mh.getGlobals().get( 2 );
        assertEquals( "nee.Nah",
                      i.getType() );
        assertEquals( "d",
                      i.getName() );

    }
View Full Code Here

        Import i = mh.getImports().get( 0 );
        assertEquals( "goo.bar.Whee",
                      i.getType() );

        Global g = mh.getGlobals().get( 0 );
        assertEquals( "wee.waah.Foo",
                      g.getType() );
        assertEquals( "asd",
                      g.getName() );

    }
View Full Code Here

                      mh.getImports().size() );
        Import i = mh.getImports().get( 0 );
        assertEquals( "foo.bar.Baz",
                      i.getType() );

        mh.getGlobals().add( new Global( "foo.Bar",
                                         "xs" ) );
        mh.getGlobals().add( new Global( "whee.wah",
                                         "tt" ) );
        h = ModuleHeaderHelper.renderModuleHeader( mh );
        assertEquals( "import foo.bar.Baz\nglobal foo.Bar xs\nglobal whee.wah tt",
                      h.trim() );
View Full Code Here

                        } else {
                            if ( "".equals( globalName.getText() ) ) {
                                Window.alert( Constants.INSTANCE.YouMustEnterAGlobalVariableName() );
                                return;
                            }
                            mh.getGlobals().add( new Global( type,
                                                             globalName.getText() ) );
                            doGlobals( mh );
                        }
                        updateHeader( mh );
                        pop.hide();
View Full Code Here

                        } else {
                            if ( "".equals( globalName.getText() ) ) {
                                Window.alert( Constants.INSTANCE.YouMustEnterAGlobalVariableName() );
                                return;
                            }
                            mh.getGlobals().add( new Global( type,
                                                             globalName.getText() ) );
                            doGlobals( mh );
                        }
                        updateHeader( mh );
                        pop.hide();
View Full Code Here

TOP

Related Classes of org.drools.guvnor.shared.modules.ModuleHeader.Global

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.