Example usage for com.vaadin.ui.themes ValoTheme BUTTON_SMALL

List of usage examples for com.vaadin.ui.themes ValoTheme BUTTON_SMALL

Introduction

In this page you can find the example usage for com.vaadin.ui.themes ValoTheme BUTTON_SMALL.

Prototype

String BUTTON_SMALL

To view the source code for com.vaadin.ui.themes ValoTheme BUTTON_SMALL.

Click Source Link

Document

Small size button.

Usage

From source file:com.hris.payroll.reports.ReportUI.java

private Button viewReportBtn() {
    viewReport.setWidth("200px");
    viewReport.setIcon(FontAwesome.EXCLAMATION_CIRCLE);
    viewReport.addStyleName(ValoTheme.BUTTON_PRIMARY);
    viewReport.addStyleName(ValoTheme.BUTTON_SMALL);
    viewReport.addClickListener((Button.ClickEvent e) -> {
        if (getBranchId() == 0) {
            Notification.show("Select a Branch!!!", Notification.Type.WARNING_MESSAGE);
            return;
        }//w  w w .  j  a  v  a2s .c  om

        if (getPayrollDate() == null) {
            Notification.show("Select a Payroll Date!!!", Notification.Type.WARNING_MESSAGE);
            return;
        }

        Window sub = new ReportViewer(reportType.getValue().toString(), getBranchId(), payrollDate.getValue());
        if (sub.getParent() == null) {
            UI.getCurrent().addWindow(sub);
        }
        //            switch(reportType.getValue().toString()){                
        //                case "Payslip" : {                    
        //                    if(sub.getParent() == null){
        //                        UI.getCurrent().addWindow(sub);
        //                    }
        //                    break;        
        //                }
        //                        
        //                case "Advances Summary" : {
        //                    
        //                }
        //                
        //                default: {
        //                    if(sub.getParent() == null){
        //                        UI.getCurrent().addWindow(sub);
        //                        grid.setContainerDataSource(
        //                                new PayrollAdvancesContainer(
        //                                        getBranchId(), 
        //                                        payrollDate.getValue(), 
        //                                        reportType.getValue().toString()));
        //                        removeComponent(grid);
        //                        addComponent(grid);
        //                        setExpandRatio(grid, 2);
        //                    }
        //                }                
        //            }
    });

    return viewReport;
}

From source file:com.hris.payroll.thirteenthmonth.ThirteenthMonth.java

private Button generate13thMonth() {
    Button button = new Button("13th MONTH");
    button.setWidth("200px");
    button.setIcon(FontAwesome.SPINNER);
    button.addStyleName(ValoTheme.BUTTON_PRIMARY);
    button.addStyleName(ValoTheme.BUTTON_SMALL);
    button.addClickListener((Button.ClickEvent event) -> {
        status.setValue(" Loading...");
        current = 1.0;//from   www .  j av a2  s  . c  o m
        dataSize = es.findEmployeeByBranch(getBranchId(), employmentStatus.getValue().toString(),
                CommonUtil.convertStringToInteger(year.getValue().toString())).size();

        populateDataGrid();
    });

    return button;
}

From source file:com.hris.payroll.thirteenthmonth.ThirteenthMonth.java

private Button exportToExcelButton() {
    exportToExcelButton.setWidth("200px");
    exportToExcelButton.setIcon(FontAwesome.EXCLAMATION_CIRCLE);
    exportToExcelButton.addStyleName(ValoTheme.BUTTON_PRIMARY);
    exportToExcelButton.addStyleName(ValoTheme.BUTTON_SMALL);
    exportToExcelButton.addClickListener((Button.ClickEvent e) -> {
        ExportDataGridToExcel exportGrid = new ExportDataGridToExcel(grid);
        exportGrid.workSheet();/* w ww. j a  va  2s .c om*/

        StreamResource.StreamSource source = () -> {
            try {
                File f = new File(exportGrid.getFilePath());
                FileInputStream fis = new FileInputStream(f);
                return fis;
            } catch (Exception e1) {
                e1.getMessage();
                return null;
            }
        };

        Date date = new Date();
        String branchName = cs.getBranchById(getBranchId());
        int tradeId = cs.getTradeIdByBranchId(getBranchId());
        String tradeName = cs.getTradeById(tradeId);
        int corporateId = cs.getCorporateIdByTradeId(tradeId);
        String corporateName = cs.getCorporateById(corporateId);

        StreamResource resource = new StreamResource(source, "ThirteenthMonth-" + corporateName + "-"
                + tradeName + "-" + branchName + "-" + date.getTime() + ".xls");
        resource.setMIMEType("application/vnd.ms-office");

        Page.getCurrent().open(resource, null, false);
    });

    return exportToExcelButton;
}

From source file:com.hybridbpm.ui.component.adaptive.AdaptiveTaskEditor.java

License:Apache License

public AdaptiveTaskEditor(DashboardTab panelView, Case case1) {
    this.panelView = panelView;
    this.case1 = case1;
    Design.read(this);

    btnSend.setIcon(FontAwesome.SEND);// ww  w . j  a  v  a 2 s  . c  o  m
    btnSend.addClickListener(this);
    btnProcess.addClickListener(this);

    TextComplete textComplete = new TextComplete();
    textComplete.extend(taskTitle, HybridbpmUI.getAccessAPI().findUserNamesByName(null),
            Arrays.asList(new String[] { "loan", "creditcard" }));

    taskTitle.addTextChangeListener(new FieldEvents.TextChangeListener() {

        @Override
        public void textChange(FieldEvents.TextChangeEvent event) {
            String text = event.getText();
            String[] lines = text.split(System.getProperty("line.separator"));
            if (lines != null && (lines.length > 1)) {
                taskTitle.setRows(lines.length + 2);
            }
        }
    });

    btnBack.addClickListener(this);
    btnBack.setStyleName(ValoTheme.BUTTON_LINK);
    btnBack.addStyleName(ValoTheme.BUTTON_SMALL);
    btnBack.setIcon(FontAwesome.ARROW_LEFT);
}

From source file:com.hybridbpm.ui.component.adaptive.AdaptiveTaskEditor.java

License:Apache License

@Override
public void buttonClick(Button.ClickEvent event) {
    if (event.getButton().equals(btnSend)) {
    } else if (event.getButton().equals(btnProcess)) {
        adaptiveLayout.setVisible(false);
        templateLayout.removeAllComponents();
        templateLayout.setVisible(true);
        for (StartProcess startProcess : HybridbpmUI.getBpmAPI().getMyProcessToStart()) {
            String startTaskTitle = startProcess.getProcessModel()
                    .getTaskModelByName(startProcess.getTaskName()).getTitle();
            String processTitle = startProcess.getProcessModel().getTitle()
                    .getValue(HybridbpmUI.getCurrent().getLocale());
            Button button = new Button(processTitle + " (" + startTaskTitle + ")");
            button.setData(startProcess);
            button.addClickListener(this);
            button.setStyleName(ValoTheme.BUTTON_LINK);
            button.addStyleName(ValoTheme.BUTTON_SMALL);
            button.setIcon(FontAwesome.valueOf(startProcess.getIcon()));
            templateLayout.addComponent(button);
        }//from ww w .j  a  va  2s. co m
        templateLayout.addComponent(btnBack);
        templateLayout.setComponentAlignment(btnBack, Alignment.BOTTOM_RIGHT);
    } else if (event.getButton().getData() instanceof StartProcess) {
        StartProcess spd = (StartProcess) event.getButton().getData();
        if (taskLayout != null && card.getComponentIndex(taskLayout) > -1) {
            card.removeComponent(taskLayout);
        }
        taskLayout = new TaskLayout(null, spd.getProcessModel().getName(), spd.getTaskName(), true);
        card.addComponents(taskLayout);
        card.setExpandRatio(taskLayout, 1f);
        card.setSizeFull();
        topLayout.setVisible(false);
        //            panelView.toggleMaximized(this, true);
    } else if (event.getButton().equals(btnBack)) {
        adaptiveLayout.setVisible(true);
        templateLayout.setVisible(false);
    }
}

From source file:com.hybridbpm.ui.component.bpm.designer.ProcessEditor.java

License:Apache License

public ProcessEditor(Module Module) {
    super();/*from w  w w  .j  av a  2  s. c o  m*/
    this.Module = HybridbpmUI.getDevelopmentAPI().getModuleById(Module.getId());
    this.processModel = HybridbpmCoreUtil.jsonToObject(this.Module.getModel(), ProcessModel.class);
    btnData.setIcon(FontAwesome.DATABASE);
    btnData.setStyleName(ValoTheme.BUTTON_BORDERLESS);
    btnData.addStyleName(ValoTheme.BUTTON_SMALL);
    buttonBar.addComponent(btnData, 0);
    removeComponent(horizontalSplitPanel);
    mainPanel.setSizeFull();
    addComponent(mainPanel);
    setExpandRatio(mainPanel, 1f);
    prepareModeler();
}

From source file:com.hybridbpm.ui.component.bpm.designer.ProcessModelLayout.java

License:Apache License

private void prepareButtonsBars() {
    // element button bar
    btnEdit.addStyleName(ValoTheme.BUTTON_LINK);
    btnEdit.addStyleName(ValoTheme.BUTTON_SMALL);
    btnEdit.addStyleName("edit-button");
    btnEdit.setIcon(FontAwesome.PENCIL_SQUARE);

    btnDelete.addStyleName(ValoTheme.BUTTON_LINK);
    btnDelete.addStyleName(ValoTheme.BUTTON_SMALL);
    btnDelete.addStyleName("edit-button");
    btnDelete.setIcon(FontAwesome.TIMES);

    elementButtonBar.addComponent(btnEdit);
    elementButtonBar.addComponent(btnDelete);
    elementButtonBar.setId("button-bar");

    // width button bar
    btnRight.setIcon(FontAwesome.ARROW_CIRCLE_RIGHT);
    btnRight.addStyleName(ValoTheme.BUTTON_LINK);

    btnLeft.setIcon(FontAwesome.ARROW_CIRCLE_LEFT);
    btnLeft.addStyleName(ValoTheme.BUTTON_LINK);

    widthButtonBar.addComponent(btnRight);
    widthButtonBar.addComponent(btnLeft);
    widthButtonBar.addStyleName("width-button-bar");
    widthButtonBar.setWidthUndefined();/*www .  j  a  v a  2  s .c o m*/
    addComponent(widthButtonBar);

    // height button bar
    btnUp.setIcon(FontAwesome.ARROW_CIRCLE_UP);
    btnUp.addStyleName(ValoTheme.BUTTON_LINK);

    btnDown.setIcon(FontAwesome.ARROW_CIRCLE_DOWN);
    btnDown.addStyleName(ValoTheme.BUTTON_LINK);

    heightButtonBar.addComponent(btnUp);
    heightButtonBar.addComponent(btnDown);
    heightButtonBar.addStyleName("height-button-bar");
    addComponent(heightButtonBar);
}

From source file:com.hybridbpm.ui.component.bpm.TaskLayout.java

License:Apache License

public TaskLayout(String taskId, String processName, String taskName, boolean showHeader) {
    this.taskId = taskId;
    this.processName = processName;
    this.taskName = taskName;
    this.showHeader = showHeader;

    Responsive.makeResponsive(this);
    btnAccept.setIcon(FontAwesome.CHECK);
    btnEscalate.setIcon(FontAwesome.ARROW_UP);
    btnDelegate.setIcon(FontAwesome.ARROW_DOWN);
    btnSchedule.setIcon(FontAwesome.CALENDAR);
    btnSave.setIcon(FontAwesome.SAVE);//w w  w  .  j a  v a2s.c om
    btnSend.setIcon(FontAwesome.SEND);
    //        btnClose.setIcon(FontAwesome.TIMES);

    btnSend.setStyleName(ValoTheme.BUTTON_PRIMARY);

    btnAccept.addStyleName(ValoTheme.BUTTON_SMALL);
    btnEscalate.addStyleName(ValoTheme.BUTTON_SMALL);
    btnDelegate.addStyleName(ValoTheme.BUTTON_SMALL);
    btnSchedule.addStyleName(ValoTheme.BUTTON_SMALL);
    btnSave.addStyleName(ValoTheme.BUTTON_SMALL);
    btnSend.addStyleName(ValoTheme.BUTTON_SMALL);
    btnClose.addStyleName(ValoTheme.BUTTON_SMALL);

    priorityMenubar.setStyleName(ValoTheme.MENUBAR_SMALL);

    //        buttonBar.setWidth(100, Unit.PERCENTAGE);
    buttonBar.setSpacing(true);
    buttonBar.addStyleName("toolbar");
    //        buttonBar.setExpandRatio(btnAccept, 1f);
    //        buttonBar.setComponentAlignment(priorityMenubar, Alignment.MIDDLE_LEFT);
    buttonBar.setComponentAlignment(btnAccept, Alignment.MIDDLE_RIGHT);
    //        buttonBar.setComponentAlignment(btnEscalate, Alignment.MIDDLE_RIGHT);
    //        buttonBar.setComponentAlignment(btnDelegate, Alignment.MIDDLE_RIGHT);
    buttonBar.setComponentAlignment(btnSchedule, Alignment.MIDDLE_RIGHT);
    buttonBar.setComponentAlignment(btnSave, Alignment.MIDDLE_RIGHT);
    buttonBar.setComponentAlignment(btnSend, Alignment.MIDDLE_RIGHT);
    buttonBar.setComponentAlignment(btnClose, Alignment.MIDDLE_RIGHT);

    tabSheet.setStyleName(ValoTheme.TABSHEET_COMPACT_TABBAR);
    tabSheet.setStyleName(ValoTheme.TABSHEET_FRAMED);
    tabSheet.setSizeFull();

    setSizeFull();
    setSpacing(true);
    if (showHeader) {
        addComponent(taskFormHeader);
    }
    addComponent(buttonBar);
    setComponentAlignment(buttonBar, Alignment.MIDDLE_RIGHT);
    addComponent(tabSheet);
    setExpandRatio(tabSheet, 1f);
    loadForm();
}

From source file:com.hybridbpm.ui.component.chart.ChartEditor.java

License:Apache License

public ChartEditor(Module module) {
    super();//from  w  ww. j a v a 2 s.c o  m
    this.module = HybridbpmUI.getDevelopmentAPI().getModuleById(module.getId());

    if (this.module.getDesign() != null && !this.module.getDesign().isEmpty()) {
        this.diagrammePreference = HybridbpmCoreUtil.jsonToObject(this.module.getDesign(),
                DiagrammePreference.class);
    } else {
        diagrammePreference = DiagrammePreference.createDefault();
    }
    preferences.setItemDataSource(diagrammePreference);

    btnExecute.setIcon(FontAwesome.COG);
    btnExecute.setStyleName(ValoTheme.BUTTON_BORDERLESS);
    btnExecute.addStyleName(ValoTheme.BUTTON_SMALL);

    btnTest.setIcon(FontAwesome.PLAY);
    btnTest.setStyleName(ValoTheme.BUTTON_BORDERLESS);
    btnTest.addStyleName(ValoTheme.BUTTON_SMALL);

    horizontalSplitPanel.addComponents(codeEditorLayout, designEditorLayout);
    horizontalSplitPanel.setSplitPosition(50, Sizeable.Unit.PERCENTAGE);
    buttonBar.addComponent(btnTest, 0);

    table.setSizeFull();
    table.setStyleName(ValoTheme.TABLE_COMPACT);

    queryEditor.setCaption("Request");
    queryEditor.setMode(AceMode.sql);
    queryEditor.setTheme(AceTheme.textmate);
    queryEditor.setShowGutter(true);
    queryEditor.setSizeFull();

    codeEditorLayout.setSizeFull();
    codeEditorLayout.addStyleName("code");
    codeEditorLayout.setMargin(new MarginInfo(false, false, false, true));
    codeEditorLayout.setSpacing(true);
    codeEditorLayout.setExpandRatio(queryEditor, 1f);
    codeEditorLayout.setExpandRatio(table, 2f);

    for (DiagrammeChartType chartType : DiagrammeChartType.values()) {
        chartTypeGroup.addItem(chartType.toString());
        chartTypeGroup.setItemIcon(chartType, chartType.getIcon());
        chartTypeGroup.setItemCaption(chartType, chartType.getName());
    }
    chartTypeGroup.setStyleName(ValoTheme.OPTIONGROUP_HORIZONTAL);
    chartTypeGroup.addStyleName(ValoTheme.OPTIONGROUP_SMALL);
    chartTypeGroup.setImmediate(true);
    chartTypeGroup.setNullSelectionAllowed(false);
    chartTypeGroup.addValueChangeListener(this);
    addComponent(chartTypeGroup, 1);

    designEditorLayout.setSizeFull();
    designEditorLayout.addStyleName("template");
    designEditorLayout.setMargin(new MarginInfo(false, true, false, true));
    designEditorLayout.setSpacing(true);

    preferences.bind(queryEditor, DiagrammePreference.QUERY);
    preferences.bind(chartTypeGroup, DiagrammePreference.CHART_TYPE);
    refreshChartConfigurationLayout();
}

From source file:com.hybridbpm.ui.component.chart.color.GaugeBandLayout.java

License:Apache License

public GaugeBandLayout(final BeanFieldGroup<DiagrammePreference> preferences) {
    super(preferences);

    setCaption("Gauge Band Colors");
    setSizeFull();//from   www . j av a 2  s  . c om
    setSpacing(true);
    setMargin(false);

    addBandButton.setIcon(FontAwesome.PLUS);
    addBandButton.setStyleName(ValoTheme.BUTTON_BORDERLESS);
    addBandButton.addStyleName(ValoTheme.BUTTON_SMALL);

    bandAdditionButtonFrame.setSpacing(true);
    bandAdditionButtonFrame.addComponent(addBandButton);
    bandAdditionButtonFrame.setComponentAlignment(addBandButton, Alignment.MIDDLE_RIGHT);

    addComponent(bandAdditionButtonFrame);

    addBandButton.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            addBand();
        }
    });

    colorTable.setHeight("100%");
    colorTable.setWidth("100%");
    colorTable.addStyleName(ValoTheme.TABLE_COMPACT);
    colorTable.addStyleName(ValoTheme.TABLE_SMALL);
    colorTable.addStyleName("color-table");

    colorTable.addContainerProperty(Translate.getMessage("colour"), ColorPicker.class, null);
    colorTable.addContainerProperty(Translate.getMessage("start"), TextField.class, null);
    colorTable.addContainerProperty(Translate.getMessage("end"), TextField.class, null);
    colorTable.addContainerProperty("remove", Button.class, null);

    // COLOR COLUMN
    colorTable.addGeneratedColumn(Translate.getMessage("colour"), new Table.ColumnGenerator() {
        @Override
        public Object generateCell(Table source, Object itemId, Object columnId) {
            final Property<String> colorProp = tableContainer.getItem(itemId).getItemProperty("color");

            int[] col = ColourUtil.decode(colorProp.getValue());
            ColorPicker picker = new ColorPicker();
            picker.addStyleName("diagramme");
            picker.setPosition(Page.getCurrent().getBrowserWindowWidth() / 2 - 246 / 2,
                    Page.getCurrent().getBrowserWindowHeight() / 2 - 507 / 2);
            picker.setColor(new com.vaadin.shared.ui.colorpicker.Color(col[0], col[1], col[2]));

            picker.addColorChangeListener(new ColorChangeListener() {
                @Override
                public void colorChanged(ColorChangeEvent event) {
                    colorProp.setValue(event.getColor().getCSS());
                    updateDiagramme();
                }
            });
            picker.setWidth("25px");

            return picker;
        }
    });

    // BAND START COLUMN
    colorTable.addGeneratedColumn(Translate.getMessage("start"), new Table.ColumnGenerator() {
        @Override
        public Object generateCell(Table source, Object itemId, Object columnId) {
            final Property<Double> startProp = tableContainer.getContainerProperty(itemId, "startValue");

            final ObjectProperty<Double> startValue = new ObjectProperty<Double>(0.0);
            TextField startField = new TextField(startValue);
            //startField.setWidth("60px");
            startField.setSizeFull();
            startField.setNullRepresentation("0");
            startField.addStyleName("tfwb");
            startField.setConvertedValue(startProp.getValue());
            startField.setImmediate(true);

            startValue.addValueChangeListener(new Property.ValueChangeListener() {
                @Override
                public void valueChange(Property.ValueChangeEvent event) {
                    startProp.setValue((Double) event.getProperty().getValue());
                    updateDiagramme();
                }
            });

            return startField;
        }
    });

    // BAND END COLUMN
    colorTable.addGeneratedColumn(Translate.getMessage("end"), new Table.ColumnGenerator() {
        @Override
        public Object generateCell(Table source, Object itemId, Object columnId) {
            final Property<Double> endProp = tableContainer.getContainerProperty(itemId, "endValue");

            final ObjectProperty<Double> endValue = new ObjectProperty<Double>(0.0);
            TextField endField = new TextField(endValue);
            //endField.setWidth("60px");
            endField.setSizeFull();
            endField.setNullRepresentation("0");
            endField.addStyleName("tfwb");
            endField.setConvertedValue(endProp.getValue());
            endField.setImmediate(true);

            endValue.addValueChangeListener(new Property.ValueChangeListener() {
                @Override
                public void valueChange(Property.ValueChangeEvent valueChangeEvent) {
                    endProp.setValue((Double) valueChangeEvent.getProperty().getValue());
                    updateDiagramme();
                }
            });

            return endField;
        }
    });

    // DELETE BAND COLUMN
    colorTable.addGeneratedColumn("remove", new Table.ColumnGenerator() {

        @Override
        public Object generateCell(Table source, final Object itemId, Object columnId) {

            Button delete = new Button(FontAwesome.TIMES);
            delete.addClickListener(new Button.ClickListener() {
                @Override
                public void buttonClick(Button.ClickEvent event) {
                    removeBand(itemId);
                }
            });
            delete.setWidth("43px");

            return delete;
        }
    });

    colorTable.setColumnWidth(Translate.getMessage("colour"), 33);
    colorTable.setColumnWidth("remove", 48);
    colorTable.setColumnExpandRatio(Translate.getMessage("start"), 0.5f);
    colorTable.setColumnExpandRatio(Translate.getMessage("end"), 0.5f);

    colorTable.setSortEnabled(false);
    colorTable.setPageLength(0);
    colorTable.setEditable(true);
    colorTable.setImmediate(true);

    addComponent(colorTable);
    setExpandRatio(colorTable, 1f);
    setComponentAlignment(colorTable, Alignment.TOP_LEFT);
}