Package com.google.gwt.user.client.ui

Examples of com.google.gwt.user.client.ui.ScrollPanel


        layout.add( this.actionToolBar );

        TabPanel tPanel = new TabPanel();
        tPanel.setWidth( "100%" );

        ScrollPanel pnl = new ScrollPanel();
        pnl.add( this.artifactEditor );
        tPanel.add( pnl,
                    "Attributes" );
        // tPanel.selectTab(0);

        pnl = new ScrollPanel();
        // pnl1.setWidth("100%");
        pnl.add( this.ruleViewer );
        tPanel.add( pnl,
                    "Edit" );
        tPanel.selectTab( 1 );

        layout.add( tPanel );
View Full Code Here


        //init JS hooks
        this.setHooks( this );

        mainLayout = new DockLayoutPanel( Unit.EM );

        final ScrollPanel mainPanel = new ScrollPanel();

        mainLayout.add( mainPanel );

        //The package must exist (because we need at least a model to work with)
        //To make things easier (to me), the category must exist too.
        standaloneEditorService.getInvocationParameters( parametersUUID, new GenericCallback<StandaloneEditorInvocationParameters>() {

            public void onSuccess( final StandaloneEditorInvocationParameters parameters ) {

                //no assets? This is an error!
                if ( parameters.getAssetsToBeEdited().length == 0 ) {
                    Window.alert( constants.NoRulesFound() );
                    return;
                }

                //we need to store the assets.
                StandaloneEditorManager.this.assets = parameters.getAssetsToBeEdited();

                //Load SCE and create a MultiViewEditor for the assets.
                //We take the package from the first asset (because all the assets
                //must belong to the same package)


                Set<String> validFacts = null;
                if ( parameters.getValidFactTypes() != null ) {
                    validFacts = new HashSet<String>();
                    validFacts.addAll( Arrays.asList( parameters.getValidFactTypes() ) );
                }

                WorkingSetManager.getInstance().applyTemporalWorkingSetForFactTypes( assets[0].getMetaData().getPackageName(), validFacts, new Command() {

                    public void execute() {
                        LoadingPopup.close();

                        //Configure RuleModeller
                        RuleModellerConfiguration ruleModellerConfiguration = RuleModellerConfiguration.getInstance();
                        ruleModellerConfiguration.setHideLHS( parameters.isHideLHS() );
                        ruleModellerConfiguration.setHideRHS( parameters.isHideRHS() );
                        ruleModellerConfiguration.setHideAttributes( parameters.isHideAttributes() );

                        //Create the editor
                        MultiViewEditorMenuBarCreator editorMenuBarCreator;
                        if ( parameters.isTemporalAssets() ) {
                            editorMenuBarCreator = new TemporalAssetsMultiViewEditorMenuBarCreator( new Command() {
                                //"Done" buton command

                                public void execute() {
                                    afterSaveAndClose();
                                }
                            }, new Command() {
                                //"Cancel button command

                                public void execute() {
                                    afterCancelButtonCallbackFunction();
                                }
                            }
                            );
                        } else if ( parameters.getClientName().equalsIgnoreCase( "oryx" ) ) {
                            editorMenuBarCreator = new OryxMultiViewEditorMenuBarCreator( new Command() {
                                // "Close" button command
                                public void execute() {
                                    afterCloseButtonCallbackFunction();
                                }
                            } );
                        } else {
                            editorMenuBarCreator = new RealAssetsMultiViewEditorMenuBarCreator( new Command() {
                                //"Cancel" button command

                                public void execute() {
                                    afterCancelButtonCallbackFunction();
                                }
                            } );
                        }

                        editor = new MultiViewEditor(
                                parameters.getAssetsToBeEdited(),
                                clientFactory,
                                new StandaloneEditorIndividualActionToolbarButtonsConfigurationProvider(),
                                editorMenuBarCreator );

                        editor.setCloseCommand( new Command() {

                            public void execute() {
                                afterSaveAndClose();
                            }
                        } );

                        //Add the editor to main panel
                        mainPanel.add( editor );
                    }
                } );
            }
        } );
View Full Code Here

    // error statuses
    final Button addErrorsButton = new Button(GuiFactory.strings.addErrors());
    if (!errorStatuses.isEmpty()) {
      final Vector reallyAddFaults = new Vector();
      containerPanel.add(new HTML("<br />" + GuiFactory.strings.provokedFaults()));
      ScrollPanel errorContainerPanel = new ScrollPanel();
      errorContainerPanel.setStyleName("restDescribe-wadlArea");
      errorContainerPanel.setHeight(panelHeight);     
      VerticalPanel errorPanel = new VerticalPanel();
      errorContainerPanel.add(errorPanel);
      containerPanel.add(errorContainerPanel);
     
      Iterator errorIterator = errorStatuses.iterator();
      int i = 0;
      HorizontalPanel horizontalErrorPanel = new HorizontalPanel();     
      errorPanel.add(horizontalErrorPanel);
      Grid grid = new Grid(errorStatuses.size(), 2);     
      horizontalErrorPanel.add(grid);
      while (errorIterator.hasNext()) {       
        final String error = (String) errorIterator.next();
        reallyAddFaults.add(error);
        final CheckBox checkBox = new CheckBox();
        checkBox.setChecked(true);
        checkBox.addClickListener(new ClickListener() {
          public void onClick(Widget sender) {
            if (checkBox.isChecked() &&
                !reallyAddFaults.contains(error)) {             
              reallyAddFaults.add(error);
            }          
            else {
              if (reallyAddFaults.contains(error)) {
                reallyAddFaults.remove(error);
              }
            }
          }         
        });
       
        grid.setWidget(i, 0, checkBox);       
        grid.setText(i, 1, error);      
        i++;
      }     
      addErrorsButton.setEnabled(false);
      addErrorsButton.addClickListener(new ClickListener() {
        public void onClick(Widget sender) {
          // TODO         
        }
       
      });
      containerPanel.add(addErrorsButton);
    }
   
    // schema locations
    final Button addSchemaButton = new Button(GuiFactory.strings.addSchema());
    if (!schemaLocations.isEmpty()) {
      final Vector reallyAddSchemaLocations = new Vector();
      containerPanel.add(new HTML("<br />" + GuiFactory.strings.schemaLocations()));
      ScrollPanel schemaLocationContainerPanel = new ScrollPanel();
      schemaLocationContainerPanel.setStyleName("restDescribe-wadlArea");
      schemaLocationContainerPanel.setHeight(panelHeight);
      VerticalPanel schemaLocationPanel = new VerticalPanel();
      schemaLocationContainerPanel.add(schemaLocationPanel);
      containerPanel.add(schemaLocationContainerPanel);
     
      Iterator schemaLocationIterator = schemaLocations.iterator();
      int i = 0;
      HorizontalPanel horizontalSchemaPanel = new HorizontalPanel();
      schemaLocationPanel.add(horizontalSchemaPanel);
      Grid grid = new Grid(schemaLocations.size(), 2);
      horizontalSchemaPanel.add(grid);
      while (schemaLocationIterator.hasNext()) {       
        final String schemaLocation = (String) schemaLocationIterator.next();
        reallyAddSchemaLocations.add(schemaLocation);
        final CheckBox checkBox = new CheckBox();
        checkBox.setChecked(true);
        checkBox.addClickListener(new ClickListener() {
          public void onClick(Widget sender) {
            if (checkBox.isChecked() &&
                !reallyAddSchemaLocations.contains(schemaLocation)) {             
              reallyAddSchemaLocations.add(schemaLocation);
            }          
            else {
              if (reallyAddSchemaLocations.contains(schemaLocation)) {
                reallyAddSchemaLocations.remove(schemaLocation);
              }
            }
          }         
        });
       
        grid.setWidget(i, 0, checkBox);       
        grid.setText(i, 1, schemaLocation);
        i++;
      }           
      addSchemaButton.addClickListener(new ClickListener() {
        public void onClick(Widget sender) {                   
          Iterator addSchemaIterator = reallyAddSchemaLocations.iterator();
          while (addSchemaIterator.hasNext()) {
            String include = (String) addSchemaIterator.next();
            if (Analyzer.application.getGrammars() == null) {
              Analyzer.application.addGrammars(new GrammarsNode(Analyzer.application));
            }
            Analyzer.application.grammars.addInclude(include);
          }
          WadlTreeRoot wadlTreeRoot = new WadlTreeRoot();
          Tree wadlTree = wadlTreeRoot.buildTree(Analyzer.application);
          WadlPanel.wadlArea.clear();
          WadlPanel.wadlArea.setWidget(wadlTree);
        }         
      });
      containerPanel.add(addSchemaButton);
    }

    // default namespace
    final Button addNamespaceButton = new Button(GuiFactory.strings.addNamespace());
    if (!defaultNamespace.isEmpty()) {
      final Vector reallyAddDefaultNamespace = new Vector();
      containerPanel.add(new HTML("<br />" + GuiFactory.strings.defaultNamespaces()));
      ScrollPanel defaultNamespaceContainerPanel = new ScrollPanel();
      defaultNamespaceContainerPanel.setStyleName("restDescribe-wadlArea");
      defaultNamespaceContainerPanel.setHeight(panelHeight);
      VerticalPanel defaultNamespacePanel = new VerticalPanel();
      defaultNamespaceContainerPanel.add(defaultNamespacePanel);
      containerPanel.add(defaultNamespaceContainerPanel);
     
      Iterator defaultNamespaceIterator = defaultNamespace.iterator();
      int i = 0;
      HorizontalPanel horizontalNamespacePanel = new HorizontalPanel();
      defaultNamespacePanel.add(horizontalNamespacePanel);
      Grid grid = new Grid(defaultNamespace.size(), 2);
      horizontalNamespacePanel.add(grid);
      while (defaultNamespaceIterator.hasNext()) {       
        final String defaultNamespace = (String) defaultNamespaceIterator.next();
        reallyAddDefaultNamespace.add(defaultNamespace);
        final CheckBox checkBox = new CheckBox();
        checkBox.setChecked(true);
        checkBox.addClickListener(new ClickListener() {
          public void onClick(Widget sender) {
            if (checkBox.isChecked() &&
                !reallyAddDefaultNamespace.contains(defaultNamespace)) {             
              reallyAddDefaultNamespace.add(defaultNamespace);
            }          
            else {
              if (reallyAddDefaultNamespace.contains(defaultNamespace)) {
                reallyAddDefaultNamespace.remove(defaultNamespace);
              }
            }
          }         
        });
       
        grid.setWidget(i, 0, checkBox);       
        grid.setText(i, 1, defaultNamespace);
        i++;
      }           
      addNamespaceButton.addClickListener(new ClickListener() {
        public void onClick(Widget sender) {
          Iterator addNamespaceIterator = reallyAddDefaultNamespace.iterator();
          while (addNamespaceIterator.hasNext()) {
            String namespace = (String) addNamespaceIterator.next();           
            Analyzer.application.addNamespace(
                new NamespaceAttribute(null, namespace));
          }
          WadlTreeRoot wadlTreeRoot = new WadlTreeRoot();
          Tree wadlTree = wadlTreeRoot.buildTree(Analyzer.application);
          WadlPanel.wadlArea.clear();
          WadlPanel.wadlArea.setWidget(wadlTree);
        }         
      });
      containerPanel.add(addNamespaceButton);
    }
    final Button addOtherNamespacesButton = new Button(GuiFactory.strings.addOtherNamespace());
    // other namespaces
    if (!otherNamespaces.isEmpty()) {
      final Vector reallyAddOtherNamespaces = new Vector();
      containerPanel.add(new HTML("<br />" + GuiFactory.strings.otherNamespaces()));
      ScrollPanel otherNamespacesContainerPanel = new ScrollPanel();
      otherNamespacesContainerPanel.setStyleName("restDescribe-wadlArea");     
      otherNamespacesContainerPanel.setHeight(panelHeight);
      VerticalPanel otherNamespacesPanel = new VerticalPanel();
      otherNamespacesContainerPanel.add(otherNamespacesPanel);
      containerPanel.add(otherNamespacesContainerPanel);
     
      Iterator otherNamespacesIterator = otherNamespaces.iterator();
      int i = 0;
      HorizontalPanel horizontalNamespacePanel = new HorizontalPanel();
View Full Code Here

  public static void show(String html) {
    final DialogBox dialog = new DialogBox();
    dialog.setText(GuiFactory.strings.wadlPreviewDialog());
   
    VerticalPanel preview = new VerticalPanel();     
    ScrollPanel scrollPanel = new ScrollPanel();
    scrollPanel.setStyleName("restDescribe-wadlArea");
    scrollPanel.setHeight(Math.floor(Window.getClientHeight() * 0.75) + "px");
    scrollPanel.setWidth(Math.floor(Window.getClientWidth() * 0.9) + "px");   
    scrollPanel.add(new HTML(html));     
    preview.add(scrollPanel);
   
    Button closeButton = new Button(GuiFactory.strings.close());
    closeButton.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
View Full Code Here

        html.appendHtmlConstant(detailText);

        HTML widget = new HTML(html.toSafeHtml());
        widget.getElement().setAttribute("style", "margin:5px");

        ScrollPanel scroll = new ScrollPanel();
        scroll.add(widget);
        window.setWidget(scroll);

        window.addCloseHandler(new CloseHandler<PopupPanel>() {

            @Override
View Full Code Here

        // ---

        VerticalPanel panel = new VerticalPanel();
        panel.setStyleName("rhs-content-panel");

        ScrollPanel scrollPanel = WidgetUtil.asScrollPanel(panel);
        layout.add(scrollPanel);

        layout.setWidgetTopHeight(titleBar, 0, Style.Unit.PX, 28, Style.Unit.PX);
        layout.setWidgetTopHeight(toolStrip, 28, Style.Unit.PX, 30, Style.Unit.PX);
        layout.setWidgetTopHeight(scrollPanel, 58, Style.Unit.PX, 100, Style.Unit.PCT);
View Full Code Here

        DefaultPager pager = new DefaultPager();
        pager.setDisplay(deploymentTable);
        panel.add(pager);

        ScrollPanel scroll = new ScrollPanel();
        scroll.add(panel);

        layout.add(scroll);
        layout.setWidgetTopHeight(scroll, 55, Style.Unit.PX, 65, Style.Unit.PCT);
       
        return layout;
View Full Code Here

        LayoutPanel layout = new LayoutPanel();

        VerticalPanel panel = new VerticalPanel();
        panel.setStyleName("rhs-content-panel");

        ScrollPanel scroll = new ScrollPanel(panel);
        layout.add(scroll);

        layout.setWidgetTopHeight(scroll, 0, Style.Unit.PX, 100, Style.Unit.PCT);

        // ---
View Full Code Here

        layout.add(new ContentHeaderLabel("Effective ports on server: "+server.getName()));

        SocketTable socketTable = new SocketTable(server.getPortOffset());
        DefaultCellTable tableWidget = socketTable.asWidget();
        ScrollPanel scroll = new ScrollPanel(tableWidget);
        layout.add(scroll);
        socketTable.updateFrom("none", socketBindings);

        DefaultPager pager = new DefaultPager();
        pager.setDisplay(tableWidget);
View Full Code Here

        // ---

        VerticalPanel panel = new VerticalPanel();
        panel.setStyleName("rhs-content-panel");

        ScrollPanel scrollPanel = WidgetUtil.asScrollPanel(panel);
        layout.add(scrollPanel);

        layout.setWidgetTopHeight(titleBar, 0, Style.Unit.PX, 28, Style.Unit.PX);
        layout.setWidgetTopHeight(toolStrip, 28, Style.Unit.PX, 30, Style.Unit.PX);
        layout.setWidgetTopHeight(scrollPanel, 58, Style.Unit.PX, 100, Style.Unit.PCT);
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.ui.ScrollPanel

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.