Example usage for com.google.gwt.core.client.prefetch RunAsyncCode RunAsyncCode

List of usage examples for com.google.gwt.core.client.prefetch RunAsyncCode RunAsyncCode

Introduction

In this page you can find the example usage for com.google.gwt.core.client.prefetch RunAsyncCode RunAsyncCode.

Prototype

private RunAsyncCode(int splitPoint) 

Source Link

Usage

From source file:com.google.gwt.sample.showcase.client.MainMenuTreeViewModel.java

License:Apache License

/**
 * Initialize the top level categories in the tree.
 *///from  w ww  .java2  s.c om
private void initializeTree(ShowcaseConstants constants) {
    List<Category> catList = categories.getList();

    // Widgets.
    {
        Category category = new Category(constants.categoryWidgets());
        catList.add(category);
        // CwCheckBox is the default example, so don't prefetch it.
        category.addExample(new CwCheckBox(constants), null);
        category.addExample(new CwRadioButton(constants), RunAsyncCode.runAsyncCode(CwRadioButton.class));
        category.addExample(new CwBasicButton(constants), RunAsyncCode.runAsyncCode(CwBasicButton.class));
        category.addExample(new CwCustomButton(constants), RunAsyncCode.runAsyncCode(CwCustomButton.class));
        category.addExample(new CwFileUpload(constants), RunAsyncCode.runAsyncCode(CwFileUpload.class));
        category.addExample(new CwDatePicker(constants), RunAsyncCode.runAsyncCode(CwDatePicker.class));
        category.addExample(new CwHyperlink(constants), RunAsyncCode.runAsyncCode(CwHyperlink.class));
    }

    // Lists and Menus.
    {
        Category category = new Category(constants.categoryLists());
        catList.add(category);
        category.addExample(new CwListBox(constants), RunAsyncCode.runAsyncCode(CwListBox.class));
        category.addExample(new CwSuggestBox(constants), RunAsyncCode.runAsyncCode(CwSuggestBox.class));
        category.addExample(new CwTree(constants), RunAsyncCode.runAsyncCode(CwTree.class));
        category.addExample(new CwMenuBar(constants), RunAsyncCode.runAsyncCode(CwMenuBar.class));
        category.addExample(new CwStackPanel(constants), RunAsyncCode.runAsyncCode(CwStackPanel.class));
        category.addExample(new CwStackLayoutPanel(constants),
                RunAsyncCode.runAsyncCode(CwStackLayoutPanel.class));
    }

    // Text Input.
    {
        Category category = new Category(constants.categoryTextInput());
        catList.add(category);
        category.addExample(new CwBasicText(constants), RunAsyncCode.runAsyncCode(CwBasicText.class));
        category.addExample(new CwRichText(constants), RunAsyncCode.runAsyncCode(CwRichText.class));
    }

    // Popups.
    {
        Category category = new Category(constants.categoryPopups());
        catList.add(category);
        category.addExample(new CwBasicPopup(constants), RunAsyncCode.runAsyncCode(CwBasicPopup.class));
        category.addExample(new CwDialogBox(constants), RunAsyncCode.runAsyncCode(CwDialogBox.class));
    }

    // Panels.
    {
        Category category = new Category(constants.categoryPanels());
        catList.add(category);
        category.addExample(new CwDecoratorPanel(constants), RunAsyncCode.runAsyncCode(CwDecoratorPanel.class));
        category.addExample(new CwFlowPanel(constants), RunAsyncCode.runAsyncCode(CwFlowPanel.class));
        category.addExample(new CwHorizontalPanel(constants),
                RunAsyncCode.runAsyncCode(CwHorizontalPanel.class));
        category.addExample(new CwVerticalPanel(constants), RunAsyncCode.runAsyncCode(CwVerticalPanel.class));
        category.addExample(new CwAbsolutePanel(constants), RunAsyncCode.runAsyncCode(CwAbsolutePanel.class));
        category.addExample(new CwDockPanel(constants), RunAsyncCode.runAsyncCode(CwDockPanel.class));
        category.addExample(new CwDisclosurePanel(constants),
                RunAsyncCode.runAsyncCode(CwDisclosurePanel.class));
        category.addExample(new CwTabLayoutPanel(constants), RunAsyncCode.runAsyncCode(CwTabLayoutPanel.class));
        category.addExample(new CwSplitLayoutPanel(constants),
                RunAsyncCode.runAsyncCode(CwSplitLayoutPanel.class));
    }

    // Tables.
    {
        Category category = new Category(constants.categoryTables());
        catList.add(category);
        category.addExample(new CwGrid(constants), RunAsyncCode.runAsyncCode(CwGrid.class));
        category.addExample(new CwFlexTable(constants), RunAsyncCode.runAsyncCode(CwFlexTable.class));
    }

    // Cells.
    {
        Category category = new Category(constants.categoryCells());
        catList.add(category);
        category.addExample(new CwCellList(constants), RunAsyncCode.runAsyncCode(CwCellList.class));
        category.addExample(new CwCellTable(constants), RunAsyncCode.runAsyncCode(CwCellTable.class));
        category.addExample(new CwDataGrid(constants), RunAsyncCode.runAsyncCode(CwDataGrid.class));
        category.addExample(new CwCustomDataGrid(constants), RunAsyncCode.runAsyncCode(CwCustomDataGrid.class));
        category.addExample(new CwCellTree(constants), RunAsyncCode.runAsyncCode(CwCellTree.class));
        category.addExample(new CwCellBrowser(constants), RunAsyncCode.runAsyncCode(CwCellBrowser.class));
        category.addExample(new CwCellSampler(constants), RunAsyncCode.runAsyncCode(CwCellSampler.class));
        category.addExample(new CwCellValidation(constants), RunAsyncCode.runAsyncCode(CwCellValidation.class));
    }

    // I18N.
    {
        Category category = new Category(constants.categoryI18N());
        catList.add(category);
        category.addExample(new CwNumberFormat(constants), RunAsyncCode.runAsyncCode(CwNumberFormat.class));
        category.addExample(new CwDateTimeFormat(constants), RunAsyncCode.runAsyncCode(CwDateTimeFormat.class));
        category.addExample(new CwMessagesExample(constants),
                RunAsyncCode.runAsyncCode(CwMessagesExample.class));
        category.addExample(new CwBidiInput(constants), RunAsyncCode.runAsyncCode(CwBidiInput.class));
        category.addExample(new CwBidiFormatting(constants), RunAsyncCode.runAsyncCode(CwBidiFormatting.class));
        category.addExample(new CwPluralFormsExample(constants),
                RunAsyncCode.runAsyncCode(CwPluralFormsExample.class));
        category.addExample(new CwConstantsExample(constants),
                RunAsyncCode.runAsyncCode(CwConstantsExample.class));
        category.addExample(new CwConstantsWithLookupExample(constants),
                RunAsyncCode.runAsyncCode(CwConstantsWithLookupExample.class));
        category.addExample(new CwDictionaryExample(constants),
                RunAsyncCode.runAsyncCode(CwDictionaryExample.class));
    }

    // Other.
    {
        Category category = new Category(constants.categoryOther());
        catList.add(category);
        category.addExample(new CwAnimation(constants), RunAsyncCode.runAsyncCode(CwAnimation.class));
        category.addExample(new CwCookies(constants), RunAsyncCode.runAsyncCode(CwCookies.class));
    }
}

From source file:com.vo.search.admin.client.MainMenuTreeViewModel.java

License:Apache License

/**
 * Initialize the top level categories in the tree.
 */// w  w  w .  j a v  a  2s. c  om
private void initializeTree(AdminConstants constants) {
    List<Category> catList = categories.getList();

    // Widgets.
    {
        Category category = new Category(constants.categoryWidgets());
        catList.add(category);
        // CwCheckBox is the default example, so don't prefetch it.
        category.addExample(new CwQueryIndex(constants), null);
        category.addExample(new CwRadioButton(constants), RunAsyncCode.runAsyncCode(CwRadioButton.class));

    }
}

From source file:fr.drop.client.MainMenuTreeViewModel.java

License:Apache License

/**
 * Initialize the top level categories in the tree.
 *///from w  ww.  ja va  2  s .  com
private void initializeTree(DropConstants constants) {
    List<Category> catList = categories.getList();

    // Home
    {
        Category category = new Category(constants.categoryHome());
        catList.add(category);
        category.addExample(new CwHome(constants), RunAsyncCode.runAsyncCode(CwHome.class));
    }

    // Projects
    {
        Category category = new Category(constants.categoryProjects());
        catList.add(category);
        category.addExample(new CwProjectCreation(constants),
                RunAsyncCode.runAsyncCode(CwProjectCreation.class));
        category.addExample(new CwDialogBox(constants), RunAsyncCode.runAsyncCode(CwDialogBox.class));
    }

    // Profile
    {
        Category category = new Category(constants.categoryProfile());
        catList.add(category);
        category.addExample(new CwBasicText(constants), RunAsyncCode.runAsyncCode(CwBasicText.class));
        category.addExample(new CwTabLayoutPanel(constants), RunAsyncCode.runAsyncCode(CwTabLayoutPanel.class));
    }
}

From source file:fr.drop.client.MainMenuViewModel.java

License:Apache License

/**
 * Initialize the top level categories in the tree.
 *///from  w  ww  .  j  ava  2 s.c  om
private void initializeTree(DropConstants constants) {
    List<Category> catList = categories.getList();

    // Home
    {
        Category category = new Category(constants.categoryHome(), new CwHome(constants),
                RunAsyncCode.runAsyncCode(CwHome.class));
        catList.add(category);

        //         Category category = new Category(constants.categoryHome());
        //         catList.add(category);
        //         category.addExample(new CwHome(constants),
        //               RunAsyncCode.runAsyncCode(CwHome.class));
    }

    // Projects
    {
        Category category = new Category(constants.categoryProjects());
        catList.add(category);
        category.addExample(new CwProjectCreation(constants),
                RunAsyncCode.runAsyncCode(CwProjectCreation.class));
        category.addExample(new CwDialogBox(constants), RunAsyncCode.runAsyncCode(CwDialogBox.class));
    }

    // Profile
    {
        Category category = new Category(constants.categoryProfile());
        catList.add(category);
        category.addExample(new CwBasicText(constants), RunAsyncCode.runAsyncCode(CwBasicText.class));
        category.addExample(new CwTabLayoutPanel(constants), RunAsyncCode.runAsyncCode(CwTabLayoutPanel.class));
    }
}

From source file:thothbot.parallax.demo.client.DataModel.java

License:Open Source License

/**
 * Initialize the tree.//from  www .  j  a  va 2 s  .c  o m
 */
private void initializeTree() {
    List<Category> categoriesList = categories.getList();

    // Geometries.
    {
        Category category = new Category("Geometries");
        categoriesList.add(category);
        category.addExample(new GeometryCube(), RunAsyncCode.runAsyncCode(GeometryCube.class));
        category.addExample(new GeometryColors(), RunAsyncCode.runAsyncCode(GeometryColors.class));
        category.addExample(new Geometries(), RunAsyncCode.runAsyncCode(Geometries.class));
        category.addExample(new GeometriesParametric(), RunAsyncCode.runAsyncCode(GeometriesParametric.class));
        category.addExample(new GeometryDynamic(), RunAsyncCode.runAsyncCode(GeometryDynamic.class));
        category.addExample(new GeometryHierarchy(), RunAsyncCode.runAsyncCode(GeometryHierarchy.class));
        category.addExample(new Cameras(), RunAsyncCode.runAsyncCode(Cameras.class));
        category.addExample(new LinesSphere(), RunAsyncCode.runAsyncCode(LinesSphere.class));
        category.addExample(new GeometryShapes(), RunAsyncCode.runAsyncCode(GeometryShapes.class));
        category.addExample(new GeometryExtrudeSplines(),
                RunAsyncCode.runAsyncCode(GeometryExtrudeSplines.class));
        category.addExample(new BufferGeometryDemo(), RunAsyncCode.runAsyncCode(BufferGeometryDemo.class));
        category.addExample(new BufferGeometryParticles(),
                RunAsyncCode.runAsyncCode(BufferGeometryParticles.class));
        category.addExample(new GeometryNormals(), RunAsyncCode.runAsyncCode(GeometryNormals.class));
    }

    // Interactivity 
    {
        Category category = new Category("Interactivity");
        categoriesList.add(category);
        category.addExample(new InteractiveCubes(), RunAsyncCode.runAsyncCode(InteractiveCubes.class));
        //         category.addExample(new InteractiveCubesGpu(),
        //               RunAsyncCode.runAsyncCode(InteractiveCubesGpu.class));
        category.addExample(new InteractiveDraggableCubes(),
                RunAsyncCode.runAsyncCode(InteractiveDraggableCubes.class));
        category.addExample(new InteractiveVoxelPainter(),
                RunAsyncCode.runAsyncCode(InteractiveVoxelPainter.class));
    }

    // Materials
    {
        Category category = new Category("Materials");
        categoriesList.add(category);
        category.addExample(new MaterialsBumpmap(), RunAsyncCode.runAsyncCode(MaterialsBumpmap.class));
        category.addExample(new MaterialsBumpmapSkin(), RunAsyncCode.runAsyncCode(MaterialsBumpmapSkin.class));
        //         category.addExample(new MaterialsLightmap(),
        //               RunAsyncCode.runAsyncCode(MaterialsLightmap.class));
        category.addExample(new MaterialsWireframe(), RunAsyncCode.runAsyncCode(MaterialsWireframe.class));
        //         category.addExample(new MaterialsCanvas2D(),
        //               RunAsyncCode.runAsyncCode(MaterialsCanvas2D.class));
        category.addExample(new MaterialsTextures(), RunAsyncCode.runAsyncCode(MaterialsTextures.class));
        //         category.addExample(new MaterialsTextureCompressed(),
        //               RunAsyncCode.runAsyncCode(MaterialsTextureCompressed.class));
        category.addExample(new MaterialsCubemapFresnel(),
                RunAsyncCode.runAsyncCode(MaterialsCubemapFresnel.class));
        category.addExample(new MaterialsCubemapBallsReflection(),
                RunAsyncCode.runAsyncCode(MaterialsCubemapBallsReflection.class));
        category.addExample(new MaterialsCubemapBallsRefraction(),
                RunAsyncCode.runAsyncCode(MaterialsCubemapBallsRefraction.class));
        category.addExample(new MaterialsCubemapDynamicReflection(),
                RunAsyncCode.runAsyncCode(MaterialsCubemapDynamicReflection.class));
        category.addExample(new MaterialsTextureFilter(),
                RunAsyncCode.runAsyncCode(MaterialsTextureFilter.class));
        category.addExample(new MaterialsTextureAnisotropy(),
                RunAsyncCode.runAsyncCode(MaterialsTextureAnisotropy.class));
        category.addExample(new ParticlesTrails(), RunAsyncCode.runAsyncCode(ParticlesTrails.class));
        category.addExample(new ParticlesRandom(), RunAsyncCode.runAsyncCode(ParticlesRandom.class));
        category.addExample(new TrackballEarth(), RunAsyncCode.runAsyncCode(TrackballEarth.class));
        category.addExample(new MaterialsShaderLava(), RunAsyncCode.runAsyncCode(MaterialsShaderLava.class));
        category.addExample(new MaterialsShaderMonjori(),
                RunAsyncCode.runAsyncCode(MaterialsShaderMonjori.class));
        category.addExample(new ShaderOcean(), RunAsyncCode.runAsyncCode(ShaderOcean.class));
        category.addExample(new MaterialsRenderTarget(),
                RunAsyncCode.runAsyncCode(MaterialsRenderTarget.class));
    }

    // Custom Attributes
    {
        Category category = new Category("Custom Attributes");
        categoriesList.add(category);
        category.addExample(new CustomAttributesParticles(),
                RunAsyncCode.runAsyncCode(CustomAttributesParticles.class));
        category.addExample(new CustomAttributesParticles2(),
                RunAsyncCode.runAsyncCode(CustomAttributesParticles2.class));
    }

    // Animation
    {
        Category category = new Category("Animation");
        categoriesList.add(category);
        //         category.addExample(new ClothSimulation(),
        //               RunAsyncCode.runAsyncCode(ClothSimulation.class));
        category.addExample(new MorphNormalsFlamingo(), RunAsyncCode.runAsyncCode(MorphNormalsFlamingo.class));
        category.addExample(new MorphTargetsHorse(), RunAsyncCode.runAsyncCode(MorphTargetsHorse.class));
    }

    // Loaders
    //      {
    //         Category category = new Category("Loaders");
    //         categoriesList.add(category);
    //         category.addExample(new LoaderCollada(),
    //               RunAsyncCode.runAsyncCode(LoaderCollada.class));
    //      }

    // Plugins
    {
        Category category = new Category("Plugins");
        categoriesList.add(category);
        category.addExample(new TerrainDynamic(), RunAsyncCode.runAsyncCode(TerrainDynamic.class));
        category.addExample(new HilbertCurves(), RunAsyncCode.runAsyncCode(HilbertCurves.class));
        category.addExample(new PostprocessingGodrays(),
                RunAsyncCode.runAsyncCode(PostprocessingGodrays.class));
        //         category.addExample(new PostprocessingMulti(),
        //               RunAsyncCode.runAsyncCode(PostprocessingMulti.class));
        category.addExample(new EffectsLensFlares(), RunAsyncCode.runAsyncCode(EffectsLensFlares.class));
        category.addExample(new EffectsSprites(), RunAsyncCode.runAsyncCode(EffectsSprites.class));
        category.addExample(new Saturn(), RunAsyncCode.runAsyncCode(Saturn.class));

    }

    // Miscellaneous
    {
        Category category = new Category("Miscellaneous");
        categoriesList.add(category);
        category.addExample(new PerformanceDoubleSided(),
                RunAsyncCode.runAsyncCode(PerformanceDoubleSided.class));
        category.addExample(new MiscLookAt(), RunAsyncCode.runAsyncCode(MiscLookAt.class));
        category.addExample(new MiscMemoryTestGeometries(),
                RunAsyncCode.runAsyncCode(MiscMemoryTestGeometries.class));
        category.addExample(new MiscMemoryTestShaders(),
                RunAsyncCode.runAsyncCode(MiscMemoryTestShaders.class));
        category.addExample(new LoaderSTL(), RunAsyncCode.runAsyncCode(LoaderSTL.class));
    }
}