Example usage for com.vaadin.ui Label setSizeUndefined

List of usage examples for com.vaadin.ui Label setSizeUndefined

Introduction

In this page you can find the example usage for com.vaadin.ui Label setSizeUndefined.

Prototype

@Override
    public void setSizeUndefined() 

Source Link

Usage

From source file:org.jpos.qi.Sidebar.java

License:Open Source License

@SuppressWarnings("unchecked")
private void loadSideBarOptions(String id) {
    if (id != null && id.equals(currentSidebarId))
        return;// ww  w. ja v  a2  s.  c  o  m

    options = new LinkedHashMap<>();
    if (menuItems != null)
        removeComponent(menuItems);

    currentSidebarId = id;
    menuItems = new CssLayout();
    menuItems.setPrimaryStyleName("valo-menuitems");

    Element cfg = app.getXmlConfiguration();
    for (Element sb : cfg.getChildren("sidebar")) {
        String eid = sb.getAttributeValue("id");
        if (id == eid || (eid != null && eid.equals(id))) {
            for (Element e : sb.getChildren()) {
                if ("section".equals(e.getName())) {
                    Label l = new Label(e.getAttributeValue("name"));
                    l.setStyleName(ValoTheme.MENU_SUBTITLE);
                    l.setSizeUndefined();
                    menuItems.addComponent(l);
                } else if ("option".equals(e.getName())) {
                    if (((QINavigator) QI.getQI().getNavigator())
                            .hasAccessToRoute(e.getAttributeValue("action"))) {
                        Button b = new Button(e.getAttributeValue("name"));
                        b.setPrimaryStyleName(ValoTheme.MENU_ITEM);
                        String iconName = e.getAttributeValue("icon");
                        if (iconName != null) {
                            try {
                                b.setIcon(FontAwesome.valueOf(iconName));
                            } catch (IllegalArgumentException ex) {
                                b.setIcon(FontAwesome.EXCLAMATION_TRIANGLE);
                                b.setEnabled(false);
                            }
                        }
                        String action = e.getAttributeValue("action");
                        options.put(action, b);
                        if (action != null)
                            b.addClickListener((Button.ClickListener) event -> app.getNavigator()
                                    .navigateTo("/" + action));
                        menuItems.addComponent(b);
                    }
                }
            }
            addComponent(menuItems);
        }
    }
}

From source file:org.jpos.qi.system.MemoryUsageView.java

License:Open Source License

private Label createLabel() {
    Label l = new Label();
    l.setContentMode(ContentMode.HTML);
    l.setSizeUndefined();
    return l;/*w w w . j a v  a 2  s . co m*/
}

From source file:org.jpos.qi.system.MemoryUsageView.java

License:Open Source License

private Label strong(String s) {
    Label l = new Label("<strong>" + s + "</strong>");
    l.setContentMode(ContentMode.HTML);
    l.setSizeUndefined();
    return l;//from w  w  w.  j a v a2 s.  com
}

From source file:org.jumpmind.vaadin.ui.common.ResizableWindow.java

License:Open Source License

protected HorizontalLayout buildButtonFooter(Button[] toTheLeftButtons, Button... toTheRightButtons) {
    HorizontalLayout footer = new HorizontalLayout();

    footer.setWidth("100%");
    footer.setSpacing(true);/*from   w ww . j ava 2  s  . c  o  m*/
    footer.addStyleName(ValoTheme.WINDOW_BOTTOM_TOOLBAR);

    if (toTheLeftButtons != null) {
        footer.addComponents(toTheLeftButtons);
    }

    Label footerText = new Label("");
    footerText.setSizeUndefined();

    footer.addComponents(footerText);
    footer.setExpandRatio(footerText, 1);

    if (toTheRightButtons != null) {
        footer.addComponents(toTheRightButtons);
    }

    return footer;
}

From source file:org.milleni.dunning.ui.prcstart.BulkDunningProcessFinishPanel.java

License:Apache License

protected void initPageTitle() {
    HorizontalLayout layout = new HorizontalLayout();
    layout.setWidth(100, UNITS_PERCENTAGE);
    layout.addStyleName(ExplorerLayout.STYLE_TITLE_BLOCK);
    layout.setSpacing(true);/*from  w ww.j av  a 2 s  .c om*/
    layout.setMargin(false, false, true, false);
    addDetailComponent(layout);

    Embedded databaseImage = new Embedded(null, Images.DATABASE_50);
    layout.addComponent(databaseImage);

    Label groupName = new Label(i18nManager.getMessage(Messages.MAIN_MENU_DUNNING_PROCESS_BITIR));
    groupName.setSizeUndefined();
    groupName.addStyleName(Reindeer.LABEL_H2);
    layout.addComponent(groupName);
    layout.setComponentAlignment(groupName, Alignment.MIDDLE_LEFT);
    layout.setExpandRatio(groupName, 1.0f);
}

From source file:org.milleni.dunning.ui.prcstart.BulkDunningProcessStartPanel.java

License:Apache License

protected void initPageTitle() {
    HorizontalLayout layout = new HorizontalLayout();
    layout.setWidth(100, UNITS_PERCENTAGE);
    layout.addStyleName(ExplorerLayout.STYLE_TITLE_BLOCK);
    layout.setSpacing(true);//www. jav  a  2  s .co  m
    layout.setMargin(false, false, true, false);
    addDetailComponent(layout);

    Embedded databaseImage = new Embedded(null, Images.DATABASE_50);
    layout.addComponent(databaseImage);

    Label groupName = new Label(i18nManager.getMessage(Messages.MAIN_MENU_DUNNING_PROCESS_BASLAT));
    groupName.setSizeUndefined();
    groupName.addStyleName(Reindeer.LABEL_H2);
    layout.addComponent(groupName);
    layout.setComponentAlignment(groupName, Alignment.MIDDLE_LEFT);
    layout.setExpandRatio(groupName, 1.0f);

}

From source file:org.milleni.dunning.ui.prcstart.CompleteFinansTaskPanel.java

License:Apache License

protected void initPageTitle() {
    HorizontalLayout layout = new HorizontalLayout();
    layout.setWidth(100, UNITS_PERCENTAGE);
    layout.addStyleName(ExplorerLayout.STYLE_TITLE_BLOCK);
    layout.setSpacing(true);// ww  w .  j  ava 2 s  .  c  o m
    layout.setMargin(false, false, true, false);
    addDetailComponent(layout);

    Embedded databaseImage = new Embedded(null, Images.DATABASE_50);
    layout.addComponent(databaseImage);

    Label groupName = new Label("Finans Task Tamamla");
    groupName.setSizeUndefined();
    groupName.addStyleName(Reindeer.LABEL_H2);
    layout.addComponent(groupName);
    layout.setComponentAlignment(groupName, Alignment.MIDDLE_LEFT);
    layout.setExpandRatio(groupName, 1.0f);

    yasalOrTakipCombo = new ComboBox("Yasal Surec Durumu");
    yasalOrTakipCombo.addItem(yasalTakip);
    yasalOrTakipCombo.addItem(takipDisiBirak);
}

From source file:org.milleni.dunning.ui.prcstart.CompleteFinansTaskPanel.java

License:Apache License

protected void initSettingsProperties() {
    panelLayout = new VerticalLayout();
    panelLayout.setSpacing(true);//from w ww  .j a va  2  s.co  m
    detailLayout.setMargin(true, true, true, false);
    detailLayout.addComponent(panelLayout);

    // Database type

    textArea = new TextArea("");
    textArea.setRequired(true);
    textArea.setEnabled(true);
    textArea.setRows(10);
    textArea.setColumns(50);

    textAreaFinansNot = new TextArea("");
    textAreaFinansNot.setRequired(true);
    textAreaFinansNot.setEnabled(true);
    textAreaFinansNot.setRows(2);
    textAreaFinansNot.setColumns(50);
    textAreaFinansNot.setMaxLength(150);

    panelLayout.addComponent(yasalOrTakipCombo);
    Label lblFinansNot = new Label("Finans Notu");
    lblFinansNot.setSizeUndefined();
    lblFinansNot.addStyleName(Reindeer.LABEL_H2);
    panelLayout.addComponent(lblFinansNot);
    panelLayout.addComponent(textAreaFinansNot);

    Label lblCustomer = new Label("Musteriler");
    lblCustomer.setSizeUndefined();
    lblCustomer.addStyleName(Reindeer.LABEL_H2);
    panelLayout.addComponent(lblCustomer);
    panelLayout.addComponent(textArea);

    Button claimButton = new Button("Tasklari Tamamla");
    claimButton.setIcon(Images.EXECUTE);
    claimButton.addListener(new ClickListener() {
        private static final long serialVersionUID = 1L;

        public void buttonClick(ClickEvent event) {

            String customerIds = (String) textArea.getValue();
            boolean takipDisi = (yasalOrTakipCombo.getValue() != null
                    && takipDisiBirak.equals(yasalOrTakipCombo.getValue())) ? true : false;

            String finansNotu = textAreaFinansNot.getValue() != null ? textAreaFinansNot.getValue().toString()
                    : null;

            String[] customerIdArray = customerIds.split("\n");
            List<Long> customerIdList = new ArrayList<Long>();
            for (String strCustomerId : customerIdArray) {
                strCustomerId = strCustomerId.trim();
                if (StringUtils.hasText(strCustomerId)) {
                    customerIdList.add(Long.parseLong(strCustomerId));
                }
            }

            for (Long customerId : customerIdList) {
                Map<String, Object> variables = new HashMap<String, Object>();
                variables.put(Constants.customerId, customerId);
                if (loggedInUser != null)
                    variables.put(Constants.user, loggedInUser.getFullName());

                if (takipDisi)
                    variables.put(Constants.taskStatusFinans, Constants.takipDisiBirak);

                if (StringUtils.hasText(finansNotu))
                    variables.put("finansNotu", finansNotu);

                ProcessInstance instance = runtimeService.createProcessInstanceQuery()
                        .variableValueEquals("customerId", customerId).singleResult();
                Task task = taskService.createTaskQuery().taskDefinitionKeyLike("%taskYasal%")
                        .processInstanceId(instance.getProcessInstanceId()).singleResult();
                taskService.complete(task.getId(), variables);
                //runtimeService.startProcessInstanceByKey(Constants.FL100_DunningProcessInitializer,variables);
            }
            textArea.setValue("");
        }
    });

    panelLayout.addComponent(claimButton);

}

From source file:org.milleni.dunning.ui.prcstart.DunningProcessTimingOperationsPanel.java

License:Apache License

protected void initPageTitle() {
    HorizontalLayout layout = createHorizontalLayout();
    addDetailComponent(layout);//  w ww  .  j a  v  a2 s.co  m

    Embedded databaseImage = new Embedded(null, Images.DATABASE_50);
    layout.addComponent(databaseImage);

    Label groupName = new Label("Toplu Tarih Ve Adim Degistirme");
    groupName.setSizeUndefined();
    groupName.addStyleName(Reindeer.LABEL_H2);
    layout.addComponent(groupName);
    layout.setComponentAlignment(groupName, Alignment.MIDDLE_LEFT);
    layout.setExpandRatio(groupName, 1.0f);

    List<DunningPolicy> dunningPolicyList = new ArrayList<DunningPolicy>();
    Iterable<DunningPolicy> dunningPolicies = DaoHelper.getInstance().getDunningPolicyRepository().findAll();
    for (DunningPolicy dunningPolicy : dunningPolicies) {
        dunningPolicyList.add(dunningPolicy);
    }
    BeanItemContainer<DunningPolicy> objects = new BeanItemContainer(DunningPolicy.class, dunningPolicyList);

    policyCombo = new ComboBox(i18nManager.getMessage(Constants.DUNNING_POLICY_TYPE), objects);
    policyCombo.setItemCaptionPropertyId("policyName");

    stepCombo = new ComboBox(i18nManager.getMessage(Constants.DUNNING_NEXT_STEP));
    stepCombo.setItemCaptionPropertyId("stepText");

    nextStepCombo = new ComboBox(i18nManager.getMessage(Constants.DUNNING_NEXT_STEP));
    nextStepCombo.setItemCaptionPropertyId("stepText");

    nextStepDateStart = new DateField(i18nManager.getMessage(Constants.DUNNING_NEXT_STEP_DATE_START));
    executionDate = new DateField(i18nManager.getMessage(Constants.DUNNING_NEXT_STEP_DATE_START));
    nextStepDateEnd = new DateField(i18nManager.getMessage(Constants.DUNNING_NEXT_STEP_DATE_END));

    policyCombo.addListener(new ValueChangeListener() {

        @Override
        public void valueChange(ValueChangeEvent event) {
            selectedDunningPolicy = (DunningPolicy) event.getProperty().getValue();
            List<ProcessSteps> processSteps = DaoHelper.getInstance().getDunningPolicyRepository()
                    .retrieveDunningProcessSteps(selectedDunningPolicy.getPolicyId());
            BeanItemContainer<ProcessSteps> objects = new BeanItemContainer(ProcessSteps.class, processSteps);
            stepCombo.setContainerDataSource(objects);
            nextStepCombo.setContainerDataSource(objects);
        }

    });

    stepCombo.addListener(new ValueChangeListener() {

        @Override
        public void valueChange(ValueChangeEvent event) {
            selectedProcessStep = (ProcessSteps) event.getProperty().getValue();
        }

    });

    nextStepCombo.addListener(new ValueChangeListener() {

        @Override
        public void valueChange(ValueChangeEvent event) {
            nextSelectedProcessStep = (ProcessSteps) event.getProperty().getValue();
        }

    });

}

From source file:org.milleni.dunning.ui.prcstart.StepSelectStartDunningProcessPanel.java

License:Apache License

protected void initPageTitle() {
    HorizontalLayout layout = new HorizontalLayout();
    layout.setWidth(100, UNITS_PERCENTAGE);
    layout.addStyleName(ExplorerLayout.STYLE_TITLE_BLOCK);
    layout.setSpacing(true);/*from ww w.j a  v  a 2s.co m*/
    layout.setMargin(false, false, true, false);
    addDetailComponent(layout);

    Embedded databaseImage = new Embedded(null, Images.DATABASE_50);
    layout.addComponent(databaseImage);

    Label groupName = new Label(i18nManager.getMessage(Messages.MAIN_MENU_DUNNING_PROCESS_BASLAT));
    groupName.setSizeUndefined();
    groupName.addStyleName(Reindeer.LABEL_H2);
    layout.addComponent(groupName);
    layout.setComponentAlignment(groupName, Alignment.MIDDLE_LEFT);
    layout.setExpandRatio(groupName, 1.0f);

    List<DunningPolicy> dunningPolicyList = new ArrayList<DunningPolicy>();
    Iterable<DunningPolicy> dunningPolicies = DaoHelper.getInstance().getDunningPolicyRepository().findAll();
    for (DunningPolicy dunningPolicy : dunningPolicies) {
        dunningPolicyList.add(dunningPolicy);
    }
    BeanItemContainer<DunningPolicy> objects = new BeanItemContainer(DunningPolicy.class, dunningPolicyList);

    policyCombo = new ComboBox(i18nManager.getMessage(Constants.DUNNING_POLICY_TYPE), objects);
    policyCombo.setItemCaptionPropertyId("policyName");

    stepCombo = new ComboBox(i18nManager.getMessage(Constants.DUNNING_POLICY_STEP));
    stepCombo.setItemCaptionPropertyId("stepText");
    policyCombo.addListener(new ValueChangeListener() {

        @Override
        public void valueChange(ValueChangeEvent event) {
            DunningPolicy selectedDunningPolicy = (DunningPolicy) event.getProperty().getValue();
            List<ProcessSteps> processSteps = DaoHelper.getInstance().getDunningPolicyRepository()
                    .retrieveDunningProcessSteps(selectedDunningPolicy.getPolicyId());
            BeanItemContainer<ProcessSteps> objects = new BeanItemContainer(ProcessSteps.class, processSteps);
            stepCombo.setContainerDataSource(objects);
        }

    });

    stepCombo.addListener(new ValueChangeListener() {

        @Override
        public void valueChange(ValueChangeEvent event) {
            selectedProcessStep = (ProcessSteps) event.getProperty().getValue();
        }

    });

}