Package org.rhq.coregui.client.util.enhanced

Examples of org.rhq.coregui.client.util.enhanced.EnhancedToolStrip


        super.onInit();

        setWidth100();
        setHeight100();

        buttonBar = new EnhancedToolStrip();
        buttonBar.setWidth100();
        buttonBar.setMembersMargin(30);
        buttonBar.setStyleName("subtabbar");

        addMember(buttonBar);
View Full Code Here


            for (Canvas child : contents.getMembers()) {
                contents.removeChild(child);
            }

            // add a toolstrip at the top of screen for navigation, date range controls, etc...
            this.topExtraWidgets = new EnhancedToolStrip();
            topExtraWidgets.setWidth100();
            topExtraWidgets.setMembersMargin(15);
            topExtraWidgets.hide();
            contents.addMember(topExtraWidgets);

            // Title
            this.titleCanvas = new HTMLFlow();
            updateTitleCanvas(this.titleString);

            if (showHeader) {
                // titleLayout not really needed now as TitleBar has a VLayout
                titleLayout = new EnhancedVLayout();
                titleLayout.setAutoHeight();
                titleLayout.setAlign(VerticalAlignment.BOTTOM);
                contents.addMember(titleLayout, 0);
            }

            HLayout tableHeader = new HLayout();
            tableHeader.setAutoHeight();
            tableHeader.setWidth100();
            tableHeader.setMinMemberSize(27);
            tableHeader.addStyleName("tableFilter");

            if (filterForm.hasContent()) {
                filterForm.setWidth("60%");
                tableHeader.addMember(filterForm);
            }

            Label tableInfo = new Label();
            tableInfo.setStyleName("tableRowCount");
            tableInfo.setWidth("*");
            tableInfo.setWrap(false);
            tableInfo.setOverflow(Overflow.VISIBLE);
            tableInfo.setAlign(Alignment.CENTER);
            tableInfo.setValign(VerticalAlignment.CENTER);
            //tableInfo.setHeight(26);;
            setTableInfo(tableInfo);
            tableHeader.addMember(tableInfo);
            contents.addMember(tableHeader);
            refreshRowCount();

            // add the listGrid defined in onInit
            contents.addMember(listGrid);

            // Footer

            // A second toolstrip that optionally appears before the main footer - it will contain extra widgets.
            // This is hidden from view unless extra widgets are actually added to the table above the main footer.
            this.footerExtraWidgets = new EnhancedToolStrip();
            footerExtraWidgets.setWidth100();
            footerExtraWidgets.setMembersMargin(15);
            footerExtraWidgets.hide();

            contents.addMember(footerExtraWidgets);

            this.footer = new EnhancedToolStrip();
            footer.addStyleName("footer");
            footer.setWidth100();
            footer.setMembersMargin(15);
            if (!showFooter) {
                footer.hide();
View Full Code Here

        reloadConfiguration();
    }

    private EnhancedToolStrip createButtonBar() {
        EnhancedToolStrip toolStrip = new EnhancedToolStrip();
        toolStrip.setWidth100();

        toolStrip.addMember(new LayoutSpacer());

        this.saveButton = new EnhancedIButton(MSG.common_button_save());
        this.saveButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                save();
            }
        });
        this.saveButton.disable();
        toolStrip.addMember(this.saveButton);
        toolStrip.addSpacer(40);
        return toolStrip;
    }
View Full Code Here

        //pass in the resource information
        dashboardView = new DashboardView(this, dashboard, EntityContext.forResource(resourceComposite.getResource()
            .getId()), resourceComposite);
        addMember(dashboardView);

        footer = new EnhancedToolStrip();
        footer.setStyleName("footer");
        footer.setWidth100();
        footer.setMembersMargin(15);

        editButton = new EnhancedIButton(editMode ? MSG.common_title_view_mode() : MSG.common_title_edit_mode());
View Full Code Here

        form.setNumCols(2);

        final TextItem nameItem = new TextItem(FIELD_NAME.propertyName(), FIELD_NAME.title());
        nameItem.setValue(affinityGroup.getName());

        EnhancedToolStrip footer = new EnhancedToolStrip();
        footer.setPadding(5);
        footer.setWidth100();
        footer.setMembersMargin(15);

        IButton saveButton = new EnhancedIButton(MSG.common_button_save(), ButtonColor.BLUE);
        saveButton.setOverflow(Overflow.VISIBLE);
        saveButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                affinityGroup.setName(nameItem.getValueAsString());
                GWTServiceLookup.getTopologyService().updateAffinityGroup(affinityGroup, new AsyncCallback<Void>() {
                    public void onSuccess(Void result) {
                        Message msg = new Message(MSG.view_adminTopology_message_agroupRenamed(
                            String.valueOf(affinityGroupId), affinityGroup.getName(), nameItem.getValueAsString()),
                            Message.Severity.Info);
                        CoreGUI.getMessageCenter().notify(msg);
                    }

                    public void onFailure(Throwable caught) {
                        CoreGUI.getErrorHandler().handleError(
                            MSG.view_adminTopology_message_agroupRenamingFail(String.valueOf(affinityGroupId),
                                affinityGroup.getName()) + " " + caught.getMessage(), caught);
                    }
                });
            }
        });
        footer.addMember(saveButton);
        form.setItems(nameItem);
        SectionStackSection section = new SectionStackSection(MSG.common_title_details());
        section.setExpanded(false);
        section.setItems(form, footer);
View Full Code Here

                        });
                }
            }
        });
        saveButton.setDisabled(readOnly);
        EnhancedToolStrip toolStrip = new EnhancedToolStrip();
        toolStrip.setWidth100();
        toolStrip.setMembersMargin(5);
        toolStrip.setLayoutMargin(5);
        toolStrip.addMember(saveButton);

        return toolStrip;
    }
View Full Code Here

            firePropertyChangedEvent(event);
        }
    }

    private EnhancedToolStrip buildToolStrip(EnhancedVLayout layout, final SectionStack sectionStack) {
        EnhancedToolStrip toolStrip = new EnhancedToolStrip();
        toolStrip.setBackgroundImage(null);
        toolStrip.setWidth100();
        toolStrip.setMembersMargin(3);
        toolStrip.setPadding(3);

        if (getEditorTitle() != null) {
            Label titleLabel = new Label(getEditorTitle());
            titleLabel.setWrap(false);
            toolStrip.addMember(titleLabel);
        }

        Menu menu = new Menu();
        for (SectionStackSection section : sectionStack.getSections()) {
            MenuItem item = new MenuItem(section.getTitle());
            item.setAttribute("name", section.getName());
            item.addClickHandler(new ClickHandler() {
                public void onClick(MenuItemClickEvent event) {
                    int index = event.getMenu().getItemNum(event.getItem());
                    sectionStack.expandSection(index);
                    sectionStack.showSection(index);
                }
            });
            menu.addItem(item);
        }
        menu.addItem(new MenuItemSeparator());

        MenuItem hideAllItem = new MenuItem(MSG.view_configEdit_hideAll());
        hideAllItem.addClickHandler(new ClickHandler() {
            public void onClick(MenuItemClickEvent event) {
                for (int i = 0; i < sectionStack.getSections().length; i++) {
                    sectionStack.collapseSection(i);
                }
            }
        });
        menu.addItem(hideAllItem);

        toolStrip.addMember(new IMenuButton(MSG.view_configEdit_jumpToSection(), menu));

        return toolStrip;
    }
View Full Code Here

            propertyMap);
        layout.addMember(valuesCanvas);

        if (isDynamic && !isReadOnly(propertyDefinitionMap, propertyMap)) {
            // Map is not read-only - add footer with New and Delete buttons to allow user to add or remove members.
            EnhancedToolStrip buttonBar = new EnhancedToolStrip();
            buttonBar.setPadding(5);
            buttonBar.setMembersMargin(15);

            final IButton newButton = new EnhancedIButton(MSG.common_button_new(), ButtonColor.BLUE);
            newButton.setIcon(Window.getImgURL("[SKIN]/actions/add.png"));
            newButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
                public void onClick(ClickEvent clickEvent) {
                    SC.askforValue(MSG.view_configEdit_enterPropName(), new ValueCallback() {
                        public void execute(String propertyName) {
                            if (propertyMap.get(propertyName) != null) {
                                CoreGUI.getMessageCenter().notify(
                                    new Message(MSG.view_configEdit_error_3(propertyName), Message.Severity.Error,
                                        EnumSet.of(Message.Option.Transient)));
                            } else {
                                PropertySimple memberPropertySimple = new PropertySimple(propertyName, null);
                                addPropertyToDynamicMap(memberPropertySimple, propertyMap);
                                firePropertyChangedEvent(propertyMap, propertyDefinitionMapFinal, true);

                                reload();

                                CoreGUI.getMessageCenter().notify(
                                    new Message(MSG.view_configEdit_msg_1(propertyName), EnumSet
                                        .of(Message.Option.Transient)));
                            }
                        }
                    });
                }
            });
            buttonBar.addMember(newButton);

            HLayout spacer = new HLayout();
            spacer.setWidth(12);
            buttonBar.addMember(spacer);

            EnhancedHLayout deleteControlsLayout = new EnhancedHLayout();
            deleteControlsLayout.setMargin(3);
            deleteControlsLayout.setMembersMargin(3);
            deleteControlsLayout.setWidth100();
            DynamicForm deleteForm = new DynamicForm();
            deleteForm.setWidth100();

            final SelectItem selectItem = new SortedSelectItem();
            selectItem.setMultiple(true);
            selectItem.setMultipleAppearance(MultipleAppearance.GRID);
            selectItem.setTitle(MSG.common_button_delete());
            selectItem.setValueMap(propertyDefinitionMap.getMap().keySet()
                .toArray(new String[propertyDefinitionMap.getMap().size()]));

            final EnhancedIButton okButton = new EnhancedIButton(MSG.common_button_ok(), ButtonColor.BLUE);
            okButton.setDisabled(true);
            okButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
                public void onClick(ClickEvent clickEvent) {
                    SC.confirm(MSG.view_configEdit_confirm_1(), new BooleanCallback() {
                        @Override
                        public void execute(Boolean confirmed) {
                            if (confirmed) {
                                Object value = selectItem.getValue();
                                if (value != null) {
                                    String stringValue = value.toString();
                                    String[] memberPropertyNames = stringValue.split(",");
                                    for (final String memberPropertyName : memberPropertyNames) {
                                        PropertySimple memberPropertySimple = propertyMap.getSimple(memberPropertyName);
                                        removePropertyFromDynamicMap(memberPropertySimple);
                                        firePropertyChangedEvent(propertyMap, propertyDefinitionMapFinal, true);
                                    }
                                }

                                reload();
                                CoreGUI.getMessageCenter().notify(
                                    new Message(MSG.view_configEdit_msg_2(), EnumSet.of(Message.Option.Transient)));
                            }
                        }
                    });
                }
            });

            selectItem.addChangedHandler(new ChangedHandler() {
                @Override
                public void onChanged(ChangedEvent changedEvent) {
                    Object value = changedEvent.getValue();
                    if (value != null) {
                        String stringValue = value.toString();
                        String[] memberPropertyNames = stringValue.split(",");
                        okButton.setDisabled(memberPropertyNames.length == 0);
                    }
                }
            });

            deleteForm.setFields(selectItem);
            deleteControlsLayout.addMember(deleteForm);
            deleteControlsLayout.addMember(okButton);

            buttonBar.addMember(deleteControlsLayout);
            layout.addMember(buttonBar);
        }

        CanvasItem canvasItem = buildComplexPropertyField(layout);
        canvasItem.setColSpan(3);
View Full Code Here

                            });
                    }
                }
            }
        });
        EnhancedToolStrip toolStrip = new EnhancedToolStrip();
        toolStrip.setWidth100();
        toolStrip.setMembersMargin(5);
        toolStrip.setLayoutMargin(5);
        toolStrip.addMember(saveButton);

        return toolStrip;
    }
View Full Code Here

        });

        form.setItems(nameItem, addressItem, portItem, securePortItem, operationModeItem, affinityGroupItem,
            installationDateItem, lastUpdateItem);

        EnhancedToolStrip footer = new EnhancedToolStrip();
        footer.setPadding(5);
        footer.setWidth100();
        footer.setMembersMargin(15);
        footer.addMember(saveButton);

        SectionStackSection section = new SectionStackSection(MSG.common_title_details());
        section.setExpanded(true);
        section.setItems(form, footer);
View Full Code Here

TOP

Related Classes of org.rhq.coregui.client.util.enhanced.EnhancedToolStrip

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.