Java 类com.vaadin.ui.themes.BaseTheme 实例源码

项目:vexer    文件:StatSubmInfoFilterEditor.java   
private void initLayout() {

    if (parent == null) {
        minMaxCtrlBtn.setVisible(false);
        ctrlMinified = false;
    }

    addEditorBtn.setDescription("Add editor");
    addEditorBtn.setStyleName(BaseTheme.BUTTON_LINK);
    addEditorBtn.addClickListener(this);

    groupToConnectorBtn.setDescription("Group to connector");
    groupToConnectorBtn.setStyleName(BaseTheme.BUTTON_LINK);
    groupToConnectorBtn.addClickListener(this);

    HorizontalLayout extraControlBtns = new HorizontalLayout();

    extraControlBtns.addComponents(addEditorBtn, groupToConnectorBtn);

    controlsLayout.addComponent(new Label("|"));
    controlsLayout.addComponent(extraControlBtns);

    updateGroupToState();
    updateLayout();
}
项目:dhconvalidator    文件:UserSwitchPanel.java   
/**
 * Setup UI.
 */
private void initComponents() {
    List<User> users = UserList.INSTANCE.getUsers();
    userSwitchBox = new ComboBox(Messages.getString("UserSwitchPanel.boxCaption")); //$NON-NLS-1$
    setUsers(users);
    User current = (User) VaadinSession.getCurrent().getAttribute(SessionStorageKey.USER.name());
    userSwitchBox.setValue(current);

    userSwitchBox.setDescription(
        Messages.getString("UserSwitchPanel.boxDescription")); //$NON-NLS-1$
    userSwitchBox.setNewItemsAllowed(false);
    userSwitchBox.setNullSelectionAllowed(false);

    addComponent(userSwitchBox);
    btReload = new Button(Messages.getString("UserSwitchPanel.reloadCaption")); //$NON-NLS-1$
    btReload.setStyleName(BaseTheme.BUTTON_LINK);
    btReload.addStyleName("plain-link"); //$NON-NLS-1$

    addComponent(btReload);
}
项目:opennmszh    文件:NodeSelectionLinkGenerator.java   
@Override
public Object generateCell(Table source, Object itemId, Object columnId) {
    final Property nodeIdProperty = source.getContainerProperty(itemId, m_nodeIdProperty);
    Object cellValue = m_generator.generateCell(source, itemId, columnId);
    if (cellValue == null) {
        return null;
    } else {
        if (nodeIdProperty.getValue() == null) {
            return cellValue;
        } else {
            Button button = new Button((String)cellValue);
            button.setStyleName(BaseTheme.BUTTON_LINK);
            button.setDescription(nodeIdProperty.getValue().toString());
            button.addListener(new ClickListener() {
                @Override
                public void buttonClick(ClickEvent event) {
                    SelectionContext context = new DefaultSelectionContext();
                    context.selectVertexRefs(Collections.singleton(new AbstractVertexRef("nodes", nodeIdProperty.getValue().toString(), nodeIdProperty.getValue().toString())));
                    fireSelectionChangedEvent(context);
                }
            });
            return button;
        }
    }
}
项目:chipster    文件:JobLogTable.java   
public Component generateCell(Table source, final Object itemId,
        Object columnId) {

    Button link = new Button("Output");
    link.setStyleName(BaseTheme.BUTTON_LINK);
    link.setDescription("Show job output");

    link.addClickListener(new Button.ClickListener() {

        public void buttonClick(ClickEvent event) {

            select(itemId);
            view.showOutput(itemId);
        }
    });

    return link;
}
项目:chipster    文件:JobsTable.java   
public Component generateCell(Table source, final Object itemId,
        Object columnId) {

    Button link = new Button("Cancel");
    link.setStyleName(BaseTheme.BUTTON_LINK);
    link.setDescription("Cancel running job");

    link.addClickListener(new Button.ClickListener() {

        public void buttonClick(ClickEvent event) {

            select(itemId);

            if (itemId instanceof JobsEntry) {
                JobsEntry job = (JobsEntry) itemId;

                view.cancel(job);
            }
        }
    });

    return link;
}
项目:chipster    文件:StorageEntryTable.java   
public Component generateCell(Table source, final Object itemId,
                Object columnId) {

//          Property prop = source.getItem(itemId).getItemProperty(columnId);
//          if (prop != null && prop.getType() != null && prop.getType().equals(Long.class)) {

                Button link = new Button("Delete");
                link.setStyleName(BaseTheme.BUTTON_LINK);

                link.addClickListener(new Button.ClickListener() {

                    public void buttonClick(ClickEvent event) {

                        view.delete(itemId);
                    }
                });

                return link;
//          }
//          return null;
        }
项目:cis    文件:UploadComponent.java   
public UploadComponent(Project project, Category category) {
    this.project = project;
    this.category = category;

    VerticalLayout verticalLayout = new VerticalLayout();
    verticalLayout.setSpacing(true);
    verticalLayout.setMargin(true);
    setCompositionRoot(verticalLayout);

    verticalLayout.addComponent(filesVerticalLayout);

    Button button = new Button(CisConstants.uiAddAnother);
    button.setStyleName(BaseTheme.BUTTON_LINK);
    button.addListener(this);
    verticalLayout.addComponent(button);

    add();
}
项目:cis    文件:SessionControlComponent.java   
public SessionControlComponent(User user) {
    HorizontalLayout layout = new HorizontalLayout();
    layout.setSpacing(true);
    layout.setMargin(false, false, false, true);

    if(user == null || user.getId() == null) {
        layout.addComponent(restoreButton);
        layout.addComponent(loginButton);
        restoreButton.addListener(this);
        loginButton.addListener(this);
        restoreButton.setStyleName(BaseTheme.BUTTON_LINK);
        loginButton.setStyleName(BaseTheme.BUTTON_LINK);
    } else {
        layout.addComponent(new Label(user.getLogin() + " - "));
        layout.addComponent(updateButton);
        layout.addComponent(logoutButton);
        updateButton.addListener(this);
        logoutButton.addListener(this);
        updateButton.setStyleName(BaseTheme.BUTTON_LINK);
        logoutButton.setStyleName(BaseTheme.BUTTON_LINK);
    }

    setCompositionRoot(layout);
}
项目:vaadin-oauthpopup    文件:DemoUI.java   
@Override
public void authSuccessful(final String accessToken,
        final String accessTokenSecret, String oauthRawResponse) {
    hola.addComponent(new Label("Authorized."));
    Button testButton = new Button("Test " + service.name + " API");
    testButton.addStyleName(BaseTheme.BUTTON_LINK);
    hola.addComponent(testButton);
    testButton.addClickListener(new ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            GetTestComponent get = new GetTestComponent(service,
                    accessToken, accessTokenSecret);
            Window w = new Window(service.name, get);
            w.center();
            w.setWidth("75%");
            w.setHeight("75%");
            addWindow(w);
        }
    });
}
项目:cuba    文件:WindowBreadCrumbs.java   
public void update() {
    AppUI ui = AppUI.getCurrent();
    boolean isTestMode = ui.isTestMode();

    linksLayout.removeAllComponents();
    btn2win.clear();
    for (Iterator<Window> it = windows.iterator(); it.hasNext();) {
        Window window = it.next();
        Button button = new CubaButton(StringUtils.trimToEmpty(window.getCaption()), new BtnClickListener());
        button.setSizeUndefined();
        button.setStyleName(BaseTheme.BUTTON_LINK);
        button.setTabIndex(-1);

        if (isTestMode) {
            button.setCubaId("breadCrubms_Button_" + window.getId());
            button.setId(ui.getTestIdManager().getTestId("breadCrubms_Button_" + window.getId()));
        }

        btn2win.put(button, window);

        if (it.hasNext()) {
            linksLayout.addComponent(button);

            Label separatorLab = new Label("&nbsp;&gt;&nbsp;");
            separatorLab.setStyleName("c-breadcrumbs-separator");
            separatorLab.setSizeUndefined();
            separatorLab.setContentMode(ContentMode.HTML);
            linksLayout.addComponent(separatorLab);
        } else {
            Label captionLabel = new Label(window.getCaption());
            captionLabel.setStyleName("c-breadcrumbs-win-caption");
            captionLabel.setSizeUndefined();
            linksLayout.addComponent(captionLabel);

            this.label = captionLabel;
        }
    }
}
项目:dhconvalidator    文件:AboutLink.java   
public AboutLink() {
    super(Messages.getString("AboutLink.title")); //$NON-NLS-1$
    setStyleName(BaseTheme.BUTTON_LINK);
    addStyleName("plain-link"); //$NON-NLS-1$
    addClickListener(new ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            UI.getCurrent().addWindow(new AboutWindow());
        }
    });
}
项目:dhconvalidator    文件:BackLink.java   
public BackLink(final ServicesViewName backstepService) {
    super(Messages.getString("BackLink.title")); //$NON-NLS-1$
    setStyleName(BaseTheme.BUTTON_LINK);
    addStyleName("plain-link"); //$NON-NLS-1$
    addClickListener(new ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            UI.getCurrent().getNavigator().navigateTo((backstepService==null)?"":backstepService.name()); //$NON-NLS-1$
        }
    });
}
项目:dhconvalidator    文件:LogoutLink.java   
public LogoutLink() {
    super(Messages.getString("LogoutLink.title")); //$NON-NLS-1$
    setStyleName(BaseTheme.BUTTON_LINK);
    addStyleName("plain-link"); //$NON-NLS-1$
    addClickListener(new ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            List<Page> pages = new ArrayList<>();
            // keep the pages...
            for (UI ui : VaadinSession.getCurrent().getUIs()) {
                Page page = ui.getPage();
                if (page != null){
                    pages.add(page);
                }
            }

            VaadinSession.getCurrent().close();

            //... to notify them of the session close
            for (Page p : pages) {
                try {
                    p.reload();
                }
                catch (Exception e) {
                    Logger.getLogger(""); //$NON-NLS-1$
                }
            }           
        }
    });
}
项目:ExpressZip    文件:FindLayersViewComponent.java   
public RenderButton(boolean b) {
    super();
    setImmediate(true);
    setStyleName(BaseTheme.BUTTON_LINK);
    setState(b);
    setDescription("Preview the layer");
}
项目:ExpressZip    文件:FindLayersViewComponent.java   
public IndeterminateCheckBox() {
    super();
    setImmediate(true);
    setStyleName(BaseTheme.BUTTON_LINK);
    setState(OFF);
    setDescription("Select the layer for export");
}
项目:chipster    文件:Parameter.java   
private Button getDeleteButton(final Object itemId) {
    Button btDelete = new Button();
    btDelete.setIcon(new ThemeResource("images/close.png"));
    btDelete.setStyleName(BaseTheme.BUTTON_LINK);
    btDelete.addClickListener(new ClickListener() {
        private static final long serialVersionUID = -3695725710938486562L;

        @Override
        public void buttonClick(ClickEvent event) {
            typeTable.removeItem(itemId);
            enumDefaultValue.removeItem(itemId);
        }
    });
    return btDelete;
}
项目:chipster    文件:JobLogTable.java   
public Component generateCell(Table source, final Object itemId,
        Object columnId) {

    Property<?> prop = source.getItem(itemId).getItemProperty(JobLogContainer.ERROR_MESSAGE);
    if (prop != null && prop.getType() != null && prop.getType().equals(String.class)) {

        String errorMessage = (String) prop.getValue();

        if (errorMessage != null) {

            Button link = new Button();
            link.setIcon(new ThemeResource("../admin/crystal/agt_update_critical.png"));
            link.setStyleName(BaseTheme.BUTTON_LINK);
            link.setDescription("Show job error message");

            link.addClickListener(new Button.ClickListener() {

                public void buttonClick(ClickEvent event) {

                    select(itemId);
                    view.showErrorOutput(itemId);
                }
            });

            return link;
        }
    }

    return null;
}
项目:cis    文件:ProjectOverviewComponent.java   
public ProjectOverviewComponent(User user, Project project) {

    this.project = project;

    updatePhoneButton.addListener(this);
    updateCellPhoneButton.addListener(this);
    updatePhoneButton.setStyleName(BaseTheme.BUTTON_LINK);
    updateCellPhoneButton.setStyleName(BaseTheme.BUTTON_LINK);

    VerticalLayout verticalLayout = new VerticalLayout();
    verticalLayout.setSpacing(true);

    verticalLayout.addComponent(getComponent(CisConstants.uiProject, project.getName()));
    verticalLayout.addComponent(getComponent(CisConstants.uiCustomer, user.getName()));
    verticalLayout.addComponent(getComponent(CisConstants.uiEmail, user.getEmail()));
    verticalLayout.addComponent(getComponent(CisConstants.uiPhoneNumber, user.getPhoneNumber(), updatePhoneButton));
    verticalLayout.addComponent(getComponent(CisConstants.uiCellPhoneNumber, user.getPhoneNumber(), updateCellPhoneButton));

    if(project.getComments() != null && !project.getComments().isEmpty()) {
        verticalLayout.addComponent(getComponent(CisConstants.uiComments, project.getComments()));
    }

    HorizontalLayout horizontalLayout = new HorizontalLayout();
    horizontalLayout.setSizeFull();
    horizontalLayout.setSpacing(true);
    horizontalLayout.addComponent(logo);
    horizontalLayout.addComponent(verticalLayout);
    horizontalLayout.setExpandRatio(verticalLayout, 1);

    setCompositionRoot(horizontalLayout);
}
项目:cuba    文件:CubaButtonField.java   
@Override
protected Component initContent() {
    Button button = new CubaButton();
    button.setStyleName(BaseTheme.BUTTON_LINK);
    return button;
}
项目:cuba    文件:CubaRowsCount.java   
protected AbstractOrderedLayout createContentLayout() {
    HorizontalLayout contentLayout = new HorizontalLayout();
    contentLayout.setStyleName("c-paging-wrap");
    contentLayout.setSpacing(true);

    firstButton = new CubaButton();
    firstButton.setIcon(WebComponentsHelper.getIcon("icons/rows-count-first.png"));
    firstButton.setStyleName("c-paging-change-page");
    firstButton.addStyleName("c-paging-first");
    contentLayout.addComponent(firstButton);

    contentLayout.setComponentAlignment(firstButton, Alignment.MIDDLE_CENTER);

    prevButton = new CubaButton();
    prevButton.setIcon(WebComponentsHelper.getIcon("icons/rows-count-prev.png"));
    prevButton.setStyleName("c-paging-change-page");
    prevButton.addStyleName("c-paging-prev");
    contentLayout.addComponent(prevButton);
    contentLayout.setComponentAlignment(prevButton, Alignment.MIDDLE_CENTER);

    label = new Label();
    label.setWidthUndefined();
    label.setStyleName("c-paging-status");
    contentLayout.addComponent(label);
    contentLayout.setComponentAlignment(label, Alignment.MIDDLE_CENTER);

    countButton = new CubaButton("[?]");
    countButton.setWidthUndefined();
    countButton.setStyleName(BaseTheme.BUTTON_LINK);
    countButton.addStyleName("c-paging-count");
    countButton.setTabIndex(-1);
    contentLayout.addComponent(countButton);
    contentLayout.setComponentAlignment(countButton, Alignment.MIDDLE_CENTER);

    nextButton = new CubaButton();
    nextButton.setIcon(WebComponentsHelper.getIcon("icons/rows-count-next.png"));
    nextButton.setStyleName("c-paging-change-page");
    nextButton.addStyleName("c-paging-next");
    contentLayout.addComponent(nextButton);
    contentLayout.setComponentAlignment(nextButton, Alignment.MIDDLE_CENTER);

    lastButton = new CubaButton();
    lastButton.setIcon(WebComponentsHelper.getIcon("icons/rows-count-last.png"));
    lastButton.setStyleName("c-paging-change-page");
    lastButton.addStyleName("c-paging-last");
    contentLayout.addComponent(lastButton);
    contentLayout.setComponentAlignment(lastButton, Alignment.MIDDLE_CENTER);

    return contentLayout;
}
项目:cuba    文件:WebLinkButton.java   
public WebLinkButton() {
    component.addStyleName(BaseTheme.BUTTON_LINK);
}
项目:cuba    文件:WebLinkButton.java   
@Override
public void setStyleName(String name) {
    super.setStyleName(name);
    component.addStyleName(BaseTheme.BUTTON_LINK);
}
项目:cuba    文件:WebLinkButton.java   
@Override
public String getStyleName() {
    return StringUtils.normalizeSpace(super.getStyleName().replace(BaseTheme.BUTTON_LINK, ""));
}
项目:vexer    文件:StatSubmInfoFilterEditor.java   
private void doLayout() {

    invertButton.setStyleName(BaseTheme.BUTTON_LINK);
    invertButton.addClickListener(this);

    // set initial invert-state icon
    updateInvertedIndicator();

    invAndStateView.addComponent(invertButton);
    invAndStateView.setComponentAlignment(invertButton,
            Alignment.MIDDLE_LEFT);

    mainStateView.addComponent(theEditor.getMinifiedView());

    invAndStateView.addComponent(mainStateView);

    minMaxCtrlBtn.setDescription("Minim-maxim");
    minMaxCtrlBtn.setStyleName(BaseTheme.BUTTON_LINK);
    minMaxCtrlBtn.addClickListener(this);

    remButton.setStyleName(BaseTheme.BUTTON_LINK);
    remButton.addClickListener(this);
    if (parent == null) {
        remButton.setEnabled(false);
        remButton.setVisible(false);
    }

    editButton.setStyleName(BaseTheme.BUTTON_LINK);
    editButton.addClickListener(this);

    controlsLayout.addComponents(editButton, remButton);
    controlsLayout.setMargin(true);
    controlsLayout.addStyleName("ville-mild-bg");

    ctrlAndMinMaxLayout.addComponents(controlsLayout, minMaxCtrlBtn);
    ctrlAndMinMaxLayout.setComponentAlignment(controlsLayout,
            Alignment.TOP_CENTER);
    ctrlAndMinMaxLayout.setComponentAlignment(minMaxCtrlBtn,
            Alignment.BOTTOM_CENTER);

    addComponents(ctrlAndMinMaxLayout, invAndStateView);

    setComponentAlignment(ctrlAndMinMaxLayout, Alignment.TOP_CENTER);
    setComponentAlignment(invAndStateView, Alignment.BOTTOM_CENTER);

    addStyleName("ville-dashed-border");
    setMargin(true);
    setSpacing(true);
    setSizeUndefined();

    updateMinMaxCrtl();

}
项目:vexer    文件:EditorHelperStubImpl.java   
private void doLayout(String caption, String name, String desc,
        String notesForTeachers) {

    setSpacing(true);

    this.setWidth("100%");
    showDescriptions = true;

    Panel p = new Panel(caption);
    p.setWidth("100%");
    p.addStyleName("bubble");
    p.addStyleName("info-panel-bolded");

    VerticalLayout pLayout = new VerticalLayout();
    pLayout.setMargin(true);
    pLayout.setSpacing(true);
    pLayout.setWidth("100%");

    exerciseName = new TextField();
    exerciseName.setWidth("100%");
    exerciseName.setValue(name);
    exerciseName.addStyleName("component-margin-bottom");
    pLayout.addComponent(new Label(localizer
            .getUIText(StubUiConstants.EXERCISE_NAME)));
    pLayout.addComponent(exerciseName);

    description = new CleanRichTextArea();

    description.setWidth("100%");
    description.setHeight("200px");
    description.setValue(desc);
    description.addStyleName("component-margin-bottom");
    descriptionLabel = new Label(
            localizer.getUIText(StubUiConstants.DEFAULT_DESCRIPTION));
    pLayout.addComponent(descriptionLabel);
    pLayout.addComponent(description);

    notes = new TextArea();
    notes.setWidth("100%");
    notes.setRows(3);
    notes.setValue(notesForTeachers);
    notes.addStyleName("component-margin-bottom");
    notesLabel = new Label(
            localizer.getUIText(StubUiConstants.NOTES_FOR_TEACHERS));
    pLayout.addComponent(notesLabel);
    pLayout.addComponent(notes);

    hideShowButton = new Button(
            localizer.getUIText(StubUiConstants.HIDE_DESCRIPTIONS));
    hideShowButton.addClickListener(this);
    hideShowButton.setStyleName(BaseTheme.BUTTON_LINK);
    pLayout.addComponent(hideShowButton);

    p.setContent(pLayout);
    this.addComponent(p);

}
项目:abstractform    文件:VaadinBindingFormInstanceImpl.java   
@Override
public void refreshValidationSummary() {
    validationSummaryComponent.removeAllComponents();
    for (ValidationError error : validationErrosSummaryList) {
        if (error != null) {
            Component errorComponent = null;
            if (error.getFieldId() != null) {
                errorComponent = getComponentById(error.getFieldId());
            }
            if (errorComponent != null) {
                HorizontalLayout layout = new HorizontalLayout();
                if (errorComponent instanceof AbstractField) {
                    final AbstractField component = (AbstractField) errorComponent;
                    Button but = new Button(errorComponent.getCaption());
                    but.setStyleName(BaseTheme.BUTTON_LINK);

                    but.addListener(new Button.ClickListener() {

                        private static final long serialVersionUID = -635674369175495232L;

                        @Override
                        public void buttonClick(ClickEvent event) {
                            component.focus();
                            if (component instanceof AbstractField) {
                                AbstractTextField field = (AbstractTextField) component;
                                field.selectAll();
                            }
                        }
                    });
                    layout.addComponent(but);
                } else {
                    layout.addComponent(new Label(errorComponent.getCaption()));
                }
                layout.addComponent(new Label(" : " + error.getMessage()));
                validationSummaryComponent.addComponent(layout);

            } else {
                validationSummaryComponent.addComponent(new Label(error.getMessage()));
            }
        }
    }

}
项目:ExpressZip    文件:FindLayersViewComponent.java   
@Override
public void buttonClick(ClickEvent event) {
    String buttCaption = event.getButton().getCaption();
    if (buttCaption != null && buttCaption.compareTo("Add") == 0) {

        Label lblFilter = null;
        switch (filteringOn) {
        case LAYER_NAME:
            lblFilter = new Label("Name:" + axisSelectedListener.getTxtString());
            fo = new FilterObject(AxisFilters.LAYER_NAME, axisSelectedListener.getCmbNamOperation(),
                    axisSelectedListener.getTxtString());
            break;
        case KEYWORD:
            lblFilter = new Label("Keywd:" + axisSelectedListener.getTxtKeyword());
            fo = new FilterObject(AxisFilters.KEYWORD, axisSelectedListener.getCmbKeyOperation(),
                    axisSelectedListener.getTxtKeyword());
            break;
        case LOCATION:
            lblFilter = new Label("Loc:" + axisSelectedListener.getTxtLocation());
            fo = new FilterObject(AxisFilters.LOCATION, axisSelectedListener.getCmbLocOp(),
                    axisSelectedListener.getTxtLocation());
            break;
        case SRS:
            lblFilter = new Label("SRS:" + axisSelectedListener.getTxtEPSG());
            fo = new FilterObject(AxisFilters.SRS, axisSelectedListener.getTxtEPSG());
            break;
        }
        filter.addFilter(fo);
        btnFilter = new Button();
        btnFilter.addListener(filterButtonListener);
        btnFilter.setIcon(new ThemeResource("img/LayerLayerRendered16px.png"));
        btnFilter.setStyleName(BaseTheme.BUTTON_LINK);
        HorizontalLayout filterdiv = new HorizontalLayout();
        filterdiv.addStyleName("filter-flow");
        filterdiv.addComponent(btnFilter);
        filterdiv.setSizeUndefined();
        lblFilter.setWidth(Sizeable.SIZE_UNDEFINED, 0);
        filterdiv.addComponent(lblFilter);
        cssLayers.addComponent(filterdiv);
        hshFilterButtons.put(btnFilter, fo);
        ((ExpressZipWindow) getApplication().getMainWindow()).removeWindow(wndAddFilter); // close the window
        applyFilters();
    } else if (buttCaption != null && buttCaption.compareTo("Cancel") == 0) {
        ((ExpressZipWindow) getApplication().getMainWindow()).removeWindow(wndAddFilter);
    } else {
        // This is for clicking on filters currently in the app
        filter.delFilter(hshFilterButtons.get(event.getButton()), mapModel);
        hshFilterButtons.remove(event.getButton());
        cssLayers.removeComponent(event.getButton().getParent());
        applyFilters();
    }
}
项目:mideaas    文件:ShowLogButton.java   
public ShowLogButton(String text, LogView logView) {
    super(text);
    this.logView = logView;
    setStyleName(BaseTheme.BUTTON_LINK);
}