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

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


            if(detailTools!=null) panel.add(detailTools);
            panel.add(detail.widget);
        }
        else if(details.size()>0)
        {
            TabPanel tabs = new TabPanel();
            tabs.setStyleName("default-tabpanel");
            tabs.getElement().setAttribute("style", "margin-top:15px;");

            for(NamedWidget item : details)
            {

                item.widget.getElement().setAttribute("role", "application");
                tabs.add(item.widget, item.title);
            }

            panel.add(tabs);

            if(!details.isEmpty())
                tabs.selectTab(0);

        }

        return layout;
    }
View Full Code Here


        layout.clear();
        layout.add( actionToolBar );
        layout.add( messageWidget );

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

        ScrollPanel scrollPanel = new ScrollPanel();
        scrollPanel.add( artifactEditor );
        tabPanel.add( scrollPanel,
                      constants.Attributes() );

        scrollPanel = new ScrollPanel();
        scrollPanel.add( ruleViewer );
        tabPanel.add( scrollPanel,
                      constants.Edit() );
        tabPanel.selectTab( 1 );

        layout.add( tabPanel );
    }
View Full Code Here

                                              } ) );
        }

        //REVISIT: Nested TabLayoutPanel does not work, its content is truncated.
        //TabLayoutPanel tPanel = new TabLayoutPanel(2, Unit.EM);
        TabPanel tPanel = new TabPanel();

        DirtyableFlexTable codeTable = new DirtyableFlexTable();
        int codeTableRow = 0;
        int codeTableCol = 0;

        codeTable.setWidget( codeTableRow,
                             codeTableCol++,
                             new HTML( "<div class='form-field'>Init:</div>" ) );

        final TextBox initField = new TextBox();
        initField.setTitle( "init code" );
        initField.setText( getFromAccumulatePattern().getInitCode() );
        initField.setEnabled( !this.readOnly );
        codeTable.setWidget( codeTableRow++,
                             codeTableCol--,
                             initField );

        codeTable.setWidget( codeTableRow,
                             codeTableCol++,
                             new HTML( "<div class='form-field'>Action:</div>" ) );
        final TextBox actionField = new TextBox();
        actionField.setTitle( "action code" );
        actionField.setText( getFromAccumulatePattern().getActionCode() );
        actionField.setEnabled( !this.readOnly );
        codeTable.setWidget( codeTableRow++,
                             codeTableCol--,
                             actionField );

        codeTable.setWidget( codeTableRow,
                             codeTableCol++,
                             new HTML( "<div class='form-field'>Reverse:</div>" ) );
        final TextBox reverseField = new TextBox();
        reverseField.setTitle( "reverse code." );
        reverseField.setText( getFromAccumulatePattern().getReverseCode() );
        reverseField.setEnabled( !this.readOnly );
        codeTable.setWidget( codeTableRow++,
                             codeTableCol--,
                             reverseField );

        codeTable.setWidget( codeTableRow,
                             codeTableCol++,
                             new HTML( "<div class='form-field'>Result:</div>" ) );
        final TextBox resultField = new TextBox();
        resultField.setTitle( "result code" );
        resultField.setText( getFromAccumulatePattern().getResultCode() );
        resultField.setEnabled( !this.readOnly );
        codeTable.setWidget( codeTableRow++,
                             codeTableCol--,
                             resultField );

        //panel.setWidget(r++, 0, codeTable);
        ScrollPanel codePanel = new ScrollPanel();
        codePanel.add( codeTable );

        tPanel.add( codePanel,
                    "Custom Code" );

        DirtyableFlexTable functionTable = new DirtyableFlexTable();

        functionTable.setWidget( 0,
                                 0,
                                 new HTML( "<div class='form-field'>Function:</div>" ) );
        final TextBox functionField = new TextBox();
        functionField.setTitle( "function code" );
        functionField.setText( getFromAccumulatePattern().getFunction() );
        functionField.setEnabled( !this.readOnly );
        functionTable.setWidget( 0,
                                 1,
                                 functionField );

        //        panel.setWidget(r++, 0, functionTable);

        ScrollPanel functionPanel = new ScrollPanel();
        functionPanel.add( functionTable );

        tPanel.add( functionPanel,
                    "Function" );
        ChangeHandler changehandler = new ChangeHandler() {

            public void onChange( ChangeEvent event ) {
                Widget sender = (Widget) event.getSource();
                TextBox senderTB = (TextBox) event.getSource();
                String code = senderTB.getText();
                setModified( true );
                if ( sender == initField ) {
                    getFromAccumulatePattern().setFunction( null );
                    functionField.setText( "" );
                    getFromAccumulatePattern().setInitCode( code );
                } else if ( sender == actionField ) {
                    getFromAccumulatePattern().setFunction( null );
                    functionField.setText( "" );
                    getFromAccumulatePattern().setActionCode( code );
                } else if ( sender == reverseField ) {
                    getFromAccumulatePattern().setFunction( null );
                    functionField.setText( "" );
                    getFromAccumulatePattern().setReverseCode( code );
                } else if ( sender == resultField ) {
                    getFromAccumulatePattern().setFunction( null );
                    functionField.setText( "" );
                    getFromAccumulatePattern().setResultCode( code );
                } else if ( sender == functionField ) {
                    getFromAccumulatePattern().clearCodeFields();
                    initField.setText( "" );
                    actionField.setText( "" );
                    reverseField.setText( "" );
                    resultField.setText( "" );
                    getFromAccumulatePattern().setFunction( code );
                }
            }
        };

        initField.addChangeHandler( changehandler );
        actionField.addChangeHandler( changehandler );
        reverseField.addChangeHandler( changehandler );
        resultField.addChangeHandler( changehandler );
        functionField.addChangeHandler( changehandler );

        boolean useFunction = getFromAccumulatePattern().useFunctionOrCode().equals( FromAccumulateCompositeFactPattern.USE_FUNCTION );

        tPanel.selectTab( useFunction ? 1 : 0 );

        panel.setWidget( r++,
                         0,
                         tPanel );
View Full Code Here

            }
        });

        // -----------------

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

        bottomPanel.add(details.asWidget(), "Attributes");

        // -----------------

        final FormToolStrip.FormCallback<DataSource> formCallback = new FormToolStrip.FormCallback<DataSource>() {
            @Override
            public void onSave(Map<String, Object> changeset) {
                DataSource ds = getCurrentSelection();
                presenter.onSaveDSDetails(ds.getName(), changeset);
            }

            @Override
            public void onDelete(DataSource entity) {
                // n/a
            }
        };

        connectionEditor = new DataSourceConnectionEditor(presenter, formCallback);
        connectionEditor.getForm().bind(dataSourceTable.getCellTable());
        bottomPanel.add(connectionEditor.asWidget(), "Connection");

        securityEditor = new DataSourceSecurityEditor(formCallback);
        securityEditor.getForm().bind(dataSourceTable.getCellTable());
        bottomPanel.add(securityEditor.asWidget(), "Security");

        // -----------------

        connectionProps = new ConnectionProperties(presenter);
        bottomPanel.add(connectionProps.asWidget(), "Properties");

        // -----------------

        poolConfig = new PoolConfigurationView(new PoolManagement() {
            @Override
            public void onSavePoolConfig(String parentName, Map<String, Object> changeset) {
                presenter.onSavePoolConfig(parentName, changeset, false);
            }

            @Override
            public void onResetPoolConfig(String parentName, PoolConfig entity) {
                presenter.onDeletePoolConfig(parentName, entity, false);
            }

            @Override
            public void onDoFlush(String editedName) {
                if(getCurrentSelection().isEnabled())
                    presenter.onDoFlush(false, editedName);
                else
                    Console.error(Console.CONSTANTS.subsys_jca_error_datasource_notenabled());
            }
        });


        bottomPanel.add(poolConfig.asWidget(), "Pool");
        poolConfig.getForm().bind(dataSourceTable.getCellTable());


        // ----

        validationEditor = new DataSourceValidationEditor(formCallback);
        validationEditor.getForm().bind(dataSourceTable.getCellTable());
        bottomPanel.add(validationEditor.asWidget(), "Validation");

        bottomPanel.selectTab(0);

        // -----------------

        vpanel.add(new ContentGroupLabel(Console.CONSTANTS.common_label_selection()));
View Full Code Here

        disableBtn.addClickHandler(disableHandler);
        topLevelTools.addToolButtonRight(disableBtn);

        // -----

        TabPanel bottomPanel = new TabPanel();
        bottomPanel.setStyleName("default-tabpanel");
        bottomPanel.add(details.asWidget(), "Attributes");
        details.getForm().bind(dataSourceTable);

        final FormToolStrip.FormCallback<XADataSource> xaCallback = new FormToolStrip.FormCallback<XADataSource>() {
            @Override
            public void onSave(Map<String, Object> changeset) {
                DataSource ds = getCurrentSelection();
                presenter.onSaveXADetails(ds.getName(), changeset);
            }

            @Override
            public void onDelete(XADataSource entity) {
                // n/a
            }
        };

        final FormToolStrip.FormCallback<DataSource> dsCallback = new FormToolStrip.FormCallback<DataSource>() {
            @Override
            public void onSave(Map<String, Object> changeset) {
                DataSource ds = getCurrentSelection();
                presenter.onSaveXADetails(ds.getName(), changeset);
            }

            @Override
            public void onDelete(DataSource entity) {
                // n/a
            }
        };

        connectionEditor = new XADataSourceConnection(presenter, xaCallback);
        connectionEditor.getForm().bind(dataSourceTable);
        bottomPanel.add(connectionEditor.asWidget(), "Connection");

        securityEditor = new DataSourceSecurityEditor(dsCallback);
        securityEditor.getForm().bind(dataSourceTable);
        bottomPanel.add(securityEditor.asWidget(), "Security");

        bottomPanel.add(propertyEditor.asWidget(), "Properties");
        propertyEditor.setAllowEditProps(false);

        poolConfig = new PoolConfigurationView(new PoolManagement() {
            @Override
            public void onSavePoolConfig(String parentName, Map<String, Object> changeset) {
                presenter.onSavePoolConfig(parentName, changeset, true);
            }

            @Override
            public void onResetPoolConfig(String parentName, PoolConfig entity) {
                presenter.onDeletePoolConfig(parentName, entity, true);
            }

            @Override
            public void onDoFlush(String editedName) {
                presenter.onDoFlush(true, editedName);
            }
        });
        bottomPanel.add(poolConfig.asWidget(), "Pool");
        poolConfig.getForm().bind(dataSourceTable);

        validationEditor = new DataSourceValidationEditor(dsCallback);
        validationEditor.getForm().bind(dataSourceTable);
        bottomPanel.add(validationEditor.asWidget(), "Validation");

        bottomPanel.selectTab(0);
        vpanel.add(new ContentGroupLabel(Console.CONSTANTS.common_label_selection()));
        vpanel.add(bottomPanel);
        return layout;
    }
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 widget.
        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);


        // Unmanaged form
        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());


        // Composite view

        tabs.add(layout, "Managed");
        tabs.add(unmanagedPanel, "Unmanaged");
        tabs.selectTab(0);

        return new WindowContentBuilder(tabs, options).build();
    }
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

        rawView = new RawView();
        descView = new DescriptionView();
        nodeHeader = new NodeHeader();
        storageView = new FXTemplatesView();

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

        tabs.add(descView.asWidget(), "Description");
        tabs.add(rawView.asWidget(), "Data");

        tabs.selectTab(0);

        // --

        VerticalPanel contentPanel = new VerticalPanel();
        contentPanel.setStyleName("rhs-content-panel");
View Full Code Here

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

        vpanel.add(new ContentHeaderLabel(Console.CONSTANTS.subsys_ejb3_ejbServices()));
        vpanel.add(new ContentDescription(Console.CONSTANTS.subsys_ejb3_services_desc()));

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

        bottomPanel.add(timerServiceView.asWidget(), timerServiceView.getEntityDisplayName());
        bottomPanel.add(asyncServiceView.asWidget(), asyncServiceView.getEntityDisplayName());
        bottomPanel.add(remoteServiceView.asWidget(), remoteServiceView.getEntityDisplayName());
        bottomPanel.selectTab(0);

        vpanel.add(bottomPanel);


        return new ScrollPanel(vpanel);
View Full Code Here

TOP

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

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.