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

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


            panel.setStyleName("rhs-content-panel");

            panel.add(new ContentHeaderLabel("Role Mangement"));
            //panel.add(new ContentDescription(Console.CONSTANTS.subys_tx_desc()));

            TabPanel tabs = new TabPanel();
            tabs.setStyleName("default-tabpanel");
            tabs.getElement().setAttribute("style", "margin-top:15px;");

            tabs.add(standardRoleEditor.asWidget(),Console.CONSTANTS.administration_standard_roles());
            tabs.add(scopedRoleEditor.asWidget(), Console.CONSTANTS.administration_scoped_roles());
            tabs.selectTab(0);

            panel.add(tabs);
            return new ScrollPanel(panel);
        } else {
            return new ScrollPanel(standardRoleEditor.asWidget());
View Full Code Here


        attributesTable.setSelectionModel(ssm);


        wizard = getWizard();

        TabPanel bottomTabs = new TabPanel();
        bottomTabs.setStyleName("default-tabpanel");
        bottomTabs.add(wizard.asWidget(), "Attributes");
        bottomTabs.add(propertyEditor.asWidget(), "Module Options");

        propertyEditor.setAllowEditProps(false);

        vpanel.add(new ContentGroupLabel("Details"));

        vpanel.add(bottomTabs);
        bottomTabs.selectTab(0);

        // -------

        ScrollPanel scroll = new ScrollPanel(vpanel);
View Full Code Here

        form.setFields(name, driverClass, major, minor);

        // --

        TabPanel tabs = new TabPanel();
        tabs.setStyleName("default-tabpanel");
        tabs.addSelectionHandler(new SelectionHandler<Integer>() {
            @Override
            public void onSelection(SelectionEvent<Integer> event) {
                selectedTab = event.getSelectedItem();
            }
        });

        tabs.add(driverPanel, "Chose Driver");
        //tabs.add(form.asWidget(), "Specify Driver");

        layout.add(tabs);
        tabs.selectTab(0);


        // ----

        ClickHandler submitHandler = new ClickHandler() {
View Full Code Here

    }

    public Widget asWidget()
    {

        final TabPanel tabs = new TabPanel();
        tabs.setStyleName("default-tabpanel");

        // -------

        VerticalPanel layout = new VerticalPanel();
        layout.setStyleName("window-content");


        // Create a FormPanel and point it at a service.
        final FormPanel form = new FormPanel();
        String url = Console.getBootstrapContext().getProperty(BootstrapContext.DEPLOYMENT_API);
        form.setAction(url);

        form.setEncoding(FormPanel.ENCODING_MULTIPART);
        form.setMethod(FormPanel.METHOD_POST);

        // Create a panel to hold all of the form widgets.
        VerticalPanel panel = new VerticalPanel();
        panel.getElement().setAttribute("style", "width:100%");
        form.setWidget(panel);

        // Create a FileUpload widgets.
        final FileUpload upload = new FileUpload();
        upload.setName("uploadFormElement");
        panel.add(upload);


        final HTML errorMessages = new HTML("Please chose a file!");
        errorMessages.setStyleName("error-panel");
        errorMessages.setVisible(false);
        panel.add(errorMessages);

        // Add a 'submit' button.


        ClickHandler cancelHandler = new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                window.hide();
            }
        };

        ClickHandler submitHandler = new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {

                errorMessages.setVisible(false);

                // verify form
                String filename = upload.getFilename();

                if(tabs.getTabBar().getSelectedTab()==1)
                {
                    // unmanaged content
                    if(unmanagedForm.validate().hasErrors())
                    {
                        return;
                    }
                    else
                    {
                        wizard.onCreateUnmanaged(unmanagedForm.getUpdatedEntity());
                    }
                }
                else if(filename!=null && !filename.equals(""))
                {
                    loading = Feedback.loading(
                            Console.CONSTANTS.common_label_plaseWait(),
                            Console.CONSTANTS.common_label_requestProcessed(),
                            new Feedback.LoadingCallback() {
                                @Override
                                public void onCancel() {

                                }
                            });
                    form.submit();
                }
                else
                {
                    errorMessages.setVisible(true);
                }
            }
        };

        DialogueOptions options = new DialogueOptions(
                Console.CONSTANTS.common_label_next(), submitHandler,
                Console.CONSTANTS.common_label_cancel(), cancelHandler);

        // Add an event handler to the form.
        form.addSubmitCompleteHandler(new FormPanel.SubmitCompleteHandler() {
            @Override
            public void onSubmitComplete(FormPanel.SubmitCompleteEvent event) {

                getLoading().hide();


                String html = event.getResults();

                // Step 1: upload content, retrieve hash value
                try {

                    String json = html;

                    try {
                        if(!GWT.isScript()) // TODO: Formpanel weirdness
                            json = html.substring(html.indexOf(">")+1, html.lastIndexOf("<"));
                    } catch (StringIndexOutOfBoundsException e) {
                        // if I get this exception it means I shouldn't strip out the html
                        // this issue still needs more research
                        Log.debug("Failed to strip out HTML.  This should be preferred?");
                    }

                    JSONObject response  = JSONParser.parseLenient(json).isObject();
                    JSONObject result = response.get("result").isObject();
                    String hash= result.get("BYTES_VALUE").isString().stringValue();
                    // step2: assign name and group
                    wizard.onUploadComplete(upload.getFilename(), hash);

                } catch (Exception e) {
                    Log.error(Console.CONSTANTS.common_error_failedToDecode() + ": " + html, e);
                }


                // Option 2: Unmanaged content

            }
        });

        String stepText = "<h3>" + Console.CONSTANTS.common_label_step() + "1/2: " +
                Console.CONSTANTS.common_label_deploymentSelection() + "</h3>";
        layout.add(new HTML(stepText));
        HTML description = new HTML();
        description.setHTML(Console.CONSTANTS.common_label_chooseFile());
        description.getElement().setAttribute("style", "padding-bottom:15px;");
        layout.add(description);
        layout.add(form);
        tabs.add(layout, "Managed");

        // Unmanaged form only for new deployments
        if (!wizard.isUpdate())
        {
            VerticalPanel unmanagedPanel = new VerticalPanel();
            unmanagedPanel.setStyleName("window-content");

            String unmanagedText = "<h3>" + Console.CONSTANTS.common_label_step() + "1/1: Specify Deployment</h3>";
            unmanagedPanel.add(new HTML(unmanagedText));

            unmanagedForm = new Form<DeploymentRecord>(DeploymentRecord.class);
            TextAreaItem path = new TextAreaItem("path", "Path");
            TextBoxItem relativeTo= new TextBoxItem("relativeTo", "Relative To", false);

            TextBoxItem name = new TextBoxItem("name", "Name");
            TextBoxItem runtimeName = new TextBoxItem("runtimeName", "Runtime Name");
            CheckBoxItem archive = new CheckBoxItem("archive", "Is Archive?");
            archive.setValue(true);
            unmanagedForm.setFields(path, relativeTo, archive, name, runtimeName);
            unmanagedPanel.add(unmanagedForm.asWidget());
            tabs.add(unmanagedPanel, "Unmanaged");
        }

        tabs.selectTab(0);
        return new WindowContentBuilder(tabs, options).build();
    }
View Full Code Here

        attributesTable.setSelectionModel(ssm);


        wizard = getWizard();

        TabPanel bottomTabs = new TabPanel();
        bottomTabs.setStyleName("default-tabpanel");
        bottomTabs.add(wizard.asWidget(), "Attributes");
        bottomTabs.add(propertyEditor.asWidget(), "Module Options");

        propertyEditor.setAllowEditProps(false);

        vpanel.add(new ContentGroupLabel("Details"));

        vpanel.add(bottomTabs);
        bottomTabs.selectTab(0);

        // -------

        ScrollPanel scroll = new ScrollPanel(vpanel);
View Full Code Here

        operationsPanel.setStyleName("fill-layout-width");
        final Code code = new Code(Code.Language.JAVASCRIPT, false);
        operationsPanel.add(code);

        // form tabs
        TabPanel forms = new TabPanel();
        forms.setStyleName("default-tabpanel");
        forms.add(basicsPanel, Console.CONSTANTS.common_label_attributes());
        forms.add(operationsPanel, Console.CONSTANTS.common_label_operations());
        forms.selectTab(0);

        // update operations upon selection
        selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
            @Override
            public void onSelectionChange(final SelectionChangeEvent event) {
View Full Code Here

    public TabbedFormLayoutPanel(Class<?> beanType, FormMetaData formMetaData, EnumSet<FrameworkButton> hideButtons,
            FormItemObserver... observers) {
        this.beanType = beanType;
        this.formMetaData = formMetaData;
        this.observers = observers;
        this.tabPanel = new TabPanel();
        this.tabPanel.setStyleName("default-tabpanel");
        this.forms = makeForms();
        this.hideButtons = hideButtons;
    }
View Full Code Here

     */
    private Widget getInfoPanel() {

        VerticalPanel infoPanel = new VerticalPanel();

        TabPanel infoTabs = new TabPanel();
        infoTabs.add(getThoughts(), "Thoughts");
        infoTabs.add(getRatings(), "Ratings");

        infoTabs.selectTab(1);

        infoPanel.add(infoTabs);
        infoPanel.add(getButtons());

        return infoPanel;
View Full Code Here

     
      vp2.add(codeScroller);
    }
    vp.setSize("1024px", "500px");
   
    TabPanel tabPanel = new TabPanel();
    tabPanel.add(vp, "Validations");
    if(!testMode) {
      tabPanel.add(getMultiFieldTab(), "Multifield validations");
      tabPanel.add(transformationPanel, "Transformations");
      tabPanel.add(vp2, "Source code");
      //tabPanel.add(getTestPanel(), "Custom tests");
    }
    tabPanel.selectTab(0);
   
    if(!testMode)
      RootPanel.get("main").add(tabPanel);
    else
      RootPanel.get().add(tabPanel);
View Full Code Here

    public void onModuleLoad() {
        RootPanel.get("t1").add(t1);

        if (false) {
            final TabPanel tp = new TabPanel();
            tp.setWidth("100%");
            tp.add(t2, "t2");
            tp.selectTab(0);
            RootPanel.get("t2").add(tp);
        } else {
            RootPanel.get("t2").add(t2);
        }
View Full Code Here

TOP

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

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.