Java 类com.vaadin.ui.declarative.Design 实例源码

项目:hybridbpm    文件:DashboardView.java   
public DashboardView(ViewDefinition vd) {
    this.viewDefinition = HybridbpmUI.getDashboardAPI().getViewDefinitionById(vd.getId().toString());
    Design.read(this);
    Responsive.makeResponsive(this);

    btnAdd.addClickListener(this);
    btnAdd.setIcon(FontAwesome.PLUS_CIRCLE);
    btnAdd.setCaption("Add tab");

    btnEdit.addClickListener(this);
    btnEdit.setIcon(FontAwesome.EDIT);
    btnEdit.setCaption("Edit view");

    btnDelete.addClickListener(this);
    btnDelete.setIcon(FontAwesome.TIMES_CIRCLE);
    btnDelete.setCaption("Delete view");

    createTabs();
    checkDeveloperMode();

    tabSheet.addSelectedTabChangeListener(this);
    tabSheet.setCloseHandler(this);
}
项目:hybridbpm    文件:GroupLayout.java   
public GroupLayout(Group group) {
    Design.read(this);
    if (group == null) {
        group = new Group();
        group.setTitle(new Translated(""));
        group.setDescription(new Translated(""));
    }
    binder.setItemDataSource(group);
    binder.bind(nameTextField, "name");
    binder.bind(titleTextField, "title");
    binder.bind(descriptionTextField, "description");
    binder.setBuffered(true);

    if (group.getName() != null) {
        nameTextField.setReadOnly(true);
    }
}
项目:hybridbpm    文件:RoleLayout.java   
public RoleLayout(Role role) {
    Design.read(this);
    if (role == null) {
        role = new Role();
        role.setTitle(new Translated(""));
        role.setDescription(new Translated(""));
    }
    binder.setItemDataSource(role);
    binder.bind(nameTextField, "name");
    binder.bind(titleTextField, "title");
    binder.bind(descriptionTextField, "description");
    binder.setBuffered(true);

    if (role.getName() != null) {
        nameTextField.setReadOnly(true);
    }
}
项目:hybridbpm    文件:SystemParameterLayout.java   
public SystemParameterLayout(Parameter parameterInstance) {
    Design.read(this);
    this.parameterInstance = parameterInstance;
    if (this.parameterInstance == null) {
        this.parameterInstance = new Parameter();
    }

    for (Parameter.PARAM_TYPE type : Parameter.PARAM_TYPE.values()) {
        Item item = typeComboBox.addItem(type);
        typeComboBox.setItemCaption(type, type.name());
    }
    typeComboBox.setItemCaptionMode(AbstractSelect.ItemCaptionMode.EXPLICIT);

    binder.setItemDataSource(this.parameterInstance);
    binder.bind(typeComboBox, "type");
    binder.bind(name, "name");
    binder.bind(value, "value");
    binder.setBuffered(true);
}
项目:hybridbpm    文件:DocumentPermissionLayout.java   
public DocumentPermissionLayout(Document document, Permission permission) {
    Design.read(this);
    comboBoxRole.setCaption(Translate.getMessage("comboBoxRole"));
    permissionsField.setCaption(Translate.getMessage("permissionsField"));

    this.document = document;
    permission = permission == null ? new Permission() : permission;

    permissionsField.setPermissionsClass(Document.class);
    comboBoxRole.addContainerProperty(NAME, String.class, null);
    comboBoxRole.setItemCaptionMode(AbstractSelect.ItemCaptionMode.PROPERTY);
    comboBoxRole.setItemCaptionPropertyId(NAME);
    for (Role instance : HybridbpmUI.getAccessAPI().getAllRoles()) {
        Item item = comboBoxRole.addItem(instance);
        item.getItemProperty(NAME).setValue(instance.getName());
    }
    comboBoxRole.setNullSelectionAllowed(false);

    binder.setItemDataSource(permission);
    binder.bind(permissionsField, "permissions");
    binder.bind(comboBoxRole, "out");
    binder.setBuffered(true);


}
项目:hybridbpm    文件:AccessView.java   
public AccessView() {
    Design.read(this);
    Responsive.makeResponsive(panelLayout);
    tabSheet.addTab(usersLayout, "Users", FontAwesome.USER);
    tabSheet.addTab(userGroupsLayout, "User Group", FontAwesome.SITEMAP);
    tabSheet.addTab(groupsLayout, "Group", FontAwesome.USERS);
    tabSheet.addTab(roleGroupsLayout, "Group Role", FontAwesome.SITEMAP);
    tabSheet.addTab(rolesLayout, "Roles", FontAwesome.USERS);

    tabSheet.addSelectedTabChangeListener(this);
    usersLayout.refreshTable();
}
项目:hybridbpm    文件:TaskListView.java   
public TaskListView() {
    Design.read(this);
    Responsive.makeResponsive(panelLayout);
    tabSheet.setSizeFull();
    tabSheet.addTab(todoListLayout, Translate.getMessage("todo"), FontAwesome.ENVELOPE);
    tabSheet.addTab(doneListLayout, Translate.getMessage("done"), FontAwesome.ARCHIVE);
    tabSheet.addSelectedTabChangeListener(this);
    tabSheet.setCloseHandler(this);
    todoListLayout.refreshTable();
    todoListLayout.setTabSheet(tabSheet);
    doneListLayout.setTabSheet(tabSheet);
}
项目:hybridbpm    文件:CalendarView.java   
public CalendarView() {
    Design.read(this);
    Responsive.makeResponsive(panelLayout);
    tabSheet.setSizeFull();
    tabSheet.addTab(calendarLayout, "Calendar", FontAwesome.CALENDAR);
    tabSheet.addSelectedTabChangeListener(this);
    tabSheet.setCloseHandler(this);
    calendarLayout.refreshData();
    calendarLayout.setTabSheet(tabSheet);
}
项目:hybridbpm    文件:DevelopmentView.java   
public DevelopmentView() {
    Design.read(this);
    Responsive.makeResponsive(panelLayout);

    moduleType.addContainerProperty("NAME", String.class, null);
    moduleType.addItem(Boolean.FALSE).getItemProperty("NAME").setValue("Module");
    moduleType.addItem(Boolean.TRUE).getItemProperty("NAME").setValue("Template");
    moduleType.setItemCaptionMode(AbstractSelect.ItemCaptionMode.PROPERTY);
    moduleType.setItemCaptionPropertyId("NAME");
    moduleType.setValue(Boolean.FALSE);
    moduleType.addValueChangeListener(this);

    btnAdd.setIcon(FontAwesome.PLUS_CIRCLE);
    btnAdd.addClickListener(this);

    btnRefresh.setIcon(FontAwesome.REFRESH);
    btnRefresh.addClickListener(this);

    btnExport.setIcon(FontAwesome.CLOUD_UPLOAD);
    btnExport.addClickListener(this);

    btnImport.setIcon(FontAwesome.CLOUD_DOWNLOAD);
    btnImport.addClickListener(this);

    btnRegenerate.setIcon(FontAwesome.WRENCH);
    btnRegenerate.addClickListener(this);

    modulesLayout.setMargin(new MarginInfo(true, false, false, false));
    modulesLayout.setExpandRatio(modulesTable, 1f);

    modulesTable.addContainerProperty("title", Component.class, null, "Title", null, Table.Align.LEFT);
    modulesTable.setColumnExpandRatio("title", 1f);
    modulesTable.addContainerProperty("updateDate", Date.class, null, "Update Date", null, Table.Align.LEFT);
    modulesTable.addContainerProperty("actions", TableButtonBar.class, null, "Actions", null, Table.Align.LEFT);
    modulesTable.setColumnWidth("updateDate", 150);
    modulesTable.setColumnWidth("actions", 80);
    modulesTable.addGeneratedColumn("updateDate", new DateColumnGenerator());
    modulesTable.setVisibleColumns("title", "updateDate", "actions");
}
项目:hybridbpm    文件:DocumentView.java   
public DocumentView() {
    Design.read(this);
    tabSheet.getTab(documentsLayout).setCaption(Translate.getMessage("Documents"));
    btnSearch.setCaption(Translate.getMessage("btnSearch"));
    btnRefresh.setCaption(Translate.getMessage("btnRefresh"));
    btnAddFile.setCaption(Translate.getMessage("btnAddFile"));
    btnAddFolder.setCaption(Translate.getMessage("btnAddFolder"));
    textFieldSearch.setCaption(Translate.getMessage("textFieldSearch"));

    Responsive.makeResponsive(panelLayout);
    btnAddFolder.setIcon(FontAwesome.FOLDER_O);
    btnAddFolder.addClickListener(this);
    btnAddFile.setIcon(FontAwesome.FILE_O);
    btnAddFile.addClickListener(this);

    btnRefresh.setIcon(FontAwesome.REFRESH);
    btnRefresh.addClickListener(this);

    textFieldSearch.setIcon(FontAwesome.SEARCH);

    documentsLayout.setMargin(new MarginInfo(true, false, false, false));
    documentsLayout.setExpandRatio(documentTable, 1f);

    documentTable.addContainerProperty("name", String.class, null, Translate.getMessage("tableDocumentsName"), null, Table.Align.LEFT);
    documentTable.setColumnExpandRatio("name", 1f);
    documentTable.addContainerProperty("description", String.class, null, Translate.getMessage("tableDocumentsTitle"), null, Table.Align.LEFT);
    documentTable.addContainerProperty("creator", String.class, null, Translate.getMessage("tableDocumentsCreator"), null, Table.Align.LEFT);
    documentTable.addContainerProperty("createDate", Date.class, null, Translate.getMessage("tableDocumentsCreateDate"), null, Table.Align.LEFT);
    documentTable.addContainerProperty("updateDate", Date.class, null, Translate.getMessage("tableDocumentsUpdateDate"), null, Table.Align.LEFT);
    documentTable.addContainerProperty("actions", TableButtonBar.class, null, Translate.getMessage("tableDocumentsActions"), null, Table.Align.LEFT);
    documentTable.setColumnWidth("createDate", 150);
    documentTable.setColumnWidth("updateDate", 150);
    documentTable.setColumnWidth("actions", 55);
    documentTable.addGeneratedColumn("name", new DocumentColumnGenerator(this));
    documentTable.addGeneratedColumn("createDate", new DateColumnGenerator());
    documentTable.addGeneratedColumn("updateDate", new DateColumnGenerator());
    documentTable.setVisibleColumns("name", "description", "creator", "createDate", "updateDate", "actions");
    tabSheet.addSelectedTabChangeListener(this);
}
项目:hybridbpm    文件:AdministrationView.java   
public AdministrationView() {
        Design.read(this);
        Responsive.makeResponsive(panelLayout);
        tabSheet.addTab(systemParametersLayout, "Parameters", FontAwesome.WRENCH);
        tabSheet.addTab(allProgressLayout, "Processes", FontAwesome.COGS);
//        tabSheet.addTab(viewsLayout, "Views", FontAwesome.LIST);
        tabSheet.addSelectedTabChangeListener(this);
        systemParametersLayout.refreshTable();
        allProgressLayout.setTabSheet(tabSheet);
    }
项目:hybridbpm    文件:CaseView.java   
public CaseView() {
    Design.read(this);
    Responsive.makeResponsive(panelLayout);
    tabSheet.setSizeFull();
    tabSheet.addTab(startProcessLayout, "Start case", FontAwesome.MAGIC);
    tabSheet.addTab(myCaseInProgressLayout, "In progress", FontAwesome.BRIEFCASE);
    tabSheet.addTab(myCaseDoneLayout, "Done", FontAwesome.ARCHIVE);
    tabSheet.setSelectedTab(myCaseInProgressLayout);
    tabSheet.addSelectedTabChangeListener(this);
    tabSheet.setCloseHandler(this);
    startProcessLayout.refreshTable();
    startProcessLayout.setTabSheet(tabSheet);
    myCaseInProgressLayout.setTabSheet(tabSheet);
    myCaseDoneLayout.setTabSheet(tabSheet);
}
项目:hybridbpm    文件:MainMenu.java   
public MainMenu() {
    setSizeUndefined();
    Design.read(this);
    settingsItem = settings.addItem("", null);
    profileItem = settingsItem.addItem("Profile", this);
    settingsItem.addSeparator();
    signOutItem = settingsItem.addItem("Sign Out", this);
    valoMenuToggleButton.addClickListener(this);
    valoMenuToggleButton.setIcon(FontAwesome.LIST);
    developerButton.setIcon(FontAwesome.EYE_SLASH);
    developerButton.setDescription("Turn on developer mode");
    developerButton.addClickListener(this);
}
项目:hybridbpm    文件:AdaptiveTaskEditor.java   
public AdaptiveTaskEditor(DashboardTab panelView, Case case1) {
    this.panelView = panelView;
    this.case1 = case1;
    Design.read(this);

    btnSend.setIcon(FontAwesome.SEND);
    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);
}
项目:hybridbpm    文件:AdaptiveTaskPanel.java   
public AdaptiveTaskPanel(DashboardTab panelView, Task task) {
        this.panelView = panelView;
        this.task = task;
        Design.read(this);

        taskFormHeader.initUI(task);

//        btnOpen.setIcon(FontAwesome.EXPAND);
        btnOpen.addClickListener(this);
    }
项目:hybridbpm    文件:FileField.java   
public FileField(File file) {
    this.file = file;
     Design.read(this);
    btnDelete.setIcon(FontAwesome.TIMES);
    btnDelete.addClickListener(this);
    demandFileDownloader.extend(btnDownload);
    checkVisibility();
}
项目:hybridbpm    文件:AbstractTabLayout.java   
public AbstractTabLayout() {
    Design.read(this);
    Responsive.makeResponsive(this);

    btnAdd.setIcon(FontAwesome.PLUS_CIRCLE);
    btnAdd.addClickListener(this);

    btnRefresh.setIcon(FontAwesome.REFRESH);
    btnRefresh.addClickListener(this);

    prepareUI();
}
项目:hybridbpm    文件:TaskOptionLayout.java   
public TaskOptionLayout(Task task) {
    Design.read(this);
    Responsive.makeResponsive(this);
    scheduleStartDate.setResolution(Resolution.MINUTE);
    scheduleEndDate.setResolution(Resolution.MINUTE);
    setDefaultScheduler(task);
    binder.setItemDataSource(task);
    binder.bind(scheduleStartDate, "scheduleStartDate");
    binder.bind(scheduleEndDate, "scheduleEndDate");
    binder.setBuffered(true);
}
项目:hybridbpm    文件:FileManager.java   
public FileManager() {
    Design.read(this);
    fileUpload.setImmediate(true);
    fileUpload.addSucceededListener(imageUploader);
    fileUpload.setReceiver(imageUploader);
    setStyleName(HybridbpmStyle.LAYOUT_PADDING16);
    addStyleName("card");
}
项目:hybridbpm    文件:AbstractTableLayout.java   
public AbstractTableLayout() {
    Design.read(this);
    Responsive.makeResponsive(this);

    btnAdd.setIcon(FontAwesome.PLUS_CIRCLE);
    btnAdd.addClickListener(this);

    btnRefresh.setIcon(FontAwesome.REFRESH);
    btnRefresh.addClickListener(this);

    setExpandRatio(iTable, 1f);
    prepareTable();
}
项目:hybridbpm    文件:DashboardTab.java   
public DashboardTab(TabDefinition tab, ViewDefinition viewDefinition) {
    this.tabDefinition = tab;
    this.viewDefinition = viewDefinition;
    Design.read(this);
    Responsive.makeResponsive(this);
    btnEdit.setIcon(FontAwesome.EDIT);
    btnEdit.setDescription("Edit view");
    btnEdit.addClickListener(this);
    refresh();
    checkDeveloperMode();
}
项目:hybridbpm    文件:AbstractTreeTableLayout.java   
public AbstractTreeTableLayout() {
    Design.read(this);
    Responsive.makeResponsive(this);

    btnAdd.setIcon(FontAwesome.PLUS_CIRCLE);
    btnAdd.addClickListener(this);

    btnRefresh.setIcon(FontAwesome.REFRESH);
    btnRefresh.addClickListener(this);

    setExpandRatio(iTable, 1f);
    prepareTable();
}
项目:hybridbpm    文件:CommentViewLayout.java   
public CommentViewLayout(Comment c) {
    this.comment = c;
    Design.read(this);
    bodyField.setContentMode(ContentMode.HTML);
    bodyField.setValue(comment.getBody());
    prettyTime.setLocale(HybridbpmUI.getCurrent().getLocale());
    createDate.setValue(prettyTime.format(comment.getCreateDate()));
    createDate.setSizeUndefined();
    btnReply.setIcon(FontAwesome.REPLY);
    btnReply.addClickListener(this);
    setUserImage();
    addChildren();
}
项目:hybridbpm    文件:CommentLayout.java   
public CommentLayout(Comment comment) {
    Design.read(this);
    Responsive.makeResponsive(this);
    setMargin(false);
    CommentViewLayout commentViewLayout = new CommentViewLayout(comment);
    mainPanel.addComponent(commentViewLayout);
}
项目:hybridbpm    文件:CommentFormLayout.java   
public CommentFormLayout(Comment c, boolean deleteOnSave) {
    this.comment = c;
    this.deleteOnSave = deleteOnSave;
    Design.read(this);
    binder.setItemDataSource(this.comment);
    binder.bind(bodyField, "body");
    binder.setBuffered(true); // important
    btnSubmit.setIcon(FontAwesome.SEND);
    btnSubmit.addClickListener(this);
    setUserImage();
}
项目:hybridbpm    文件:TranslatedFieldValue.java   
public TranslatedFieldValue(Locale locale, String value) {
    Design.read(this);

    for (Locale l : Locale.getAvailableLocales()) {
        Item item = localeComboBox.addItem(l);
        localeComboBox.setItemCaptionMode(AbstractSelect.ItemCaptionMode.EXPLICIT);
        localeComboBox.setItemCaption(l, l.getDisplayName());
    }
    valueField.setValue(value);
    localeComboBox.setValue(locale);
    btnDelete.setIcon(FontAwesome.TIMES_CIRCLE);
    btnDelete.setVisible(!Locale.US.equals(locale));
    btnDelete.addClickListener(this);
    localeComboBox.setEnabled(!Locale.US.equals(locale));
}
项目:hybridbpm    文件:DocumentFormLayout.java   
public void initUI(Document document) {
    this.document = document;
    Design.read(this);
    fileLayout.setCaption(Translate.getMessage("fileLayoutCaption"));
    textFieldName.setCaption(Translate.getMessage("textFieldName"));
    fieldDescription.setCaption(Translate.getMessage("fieldDescription"));
    textFieldCreator.setCaption(Translate.getMessage("textFieldCreator"));
    textFieldMime.setCaption(Translate.getMessage("textFieldMime"));
    textFieldSize.setCaption(Translate.getMessage("textFieldSize"));
    dateFieldCreate.setCaption(Translate.getMessage("dateFieldCreate"));
    dateFieldUpdate.setCaption(Translate.getMessage("dateFieldUpdate"));

    binder.setItemDataSource(this.document);
    binder.bind(textFieldName, "name");
    binder.bind(fieldDescription, "description");
    binder.bind(textFieldCreator, "creator");
    binder.bind(dateFieldCreate, "createDate");
    binder.bind(dateFieldUpdate, "updateDate");
    binder.bind(textFieldMime, "mime");
    binder.bind(textFieldSize, "size");
    binder.setBuffered(true); // important

    fileUpload.setImmediate(true);
    fileUpload.addSucceededListener(imageUploader);
    fileUpload.setReceiver(imageUploader);
    demandFileDownloader.extend(btnDownload);

    checkVisibility();
}
项目:hybridbpm    文件:DocumentHistoryLayout.java   
public DocumentHistoryLayout() {
    Design.read(this);

    historyTable.addContainerProperty("documentVersion", Integer.class, null, Translate.getMessage("documentHistoryVersion"), null, Table.Align.RIGHT);
    historyTable.addContainerProperty("size", Integer.class, null, Translate.getMessage("documentHistorySize"), null, Table.Align.RIGHT);
    historyTable.addContainerProperty("creator", String.class, null, Translate.getMessage("documentHistoryCreator"), null, Table.Align.LEFT);
    historyTable.addContainerProperty("createDate", Date.class, null, Translate.getMessage("documentHistoryCreateDate"), null, Table.Align.LEFT);
    historyTable.addContainerProperty("actions", TableButtonBar.class, null, Translate.getMessage("documentHistoryActions"), null, Table.Align.LEFT);
    historyTable.setColumnWidth("createDate", 150);
    historyTable.setColumnWidth("actions", 55);
    historyTable.addGeneratedColumn("createDate", new DateColumnGenerator());
    historyTable.setVisibleColumns("documentVersion", "creator", "createDate", "size", "actions");

}
项目:hybridbpm    文件:DocumentAccessLayout.java   
public DocumentAccessLayout() {
    Design.read(this);
    accessTable.addContainerProperty("role", String.class, null, Translate.getMessage("documentAccessTableRole"), null, Table.Align.LEFT);
    accessTable.addContainerProperty("permission", List.class, null, Translate.getMessage("documentAccessTablePermissions"), null, Table.Align.LEFT);
    accessTable.addContainerProperty("actions", TableButtonBar.class, null, Translate.getMessage("documentAccessTableActions"), null, Table.Align.LEFT);
    accessTable.addGeneratedColumn("permission", new PermissionsColumnGenerator());
    accessTable.setColumnWidth("actions", 55);
    accessTable.setVisibleColumns("role", "permission", "actions");
}
项目:hybridbpm    文件:DocumentLayout.java   
public DocumentLayout(String documentId) {
    this.documentId = documentId;
    tabSheet.getTab(documentFormLayout).setCaption(Translate.getMessage("documentFormCaption"));
    tabSheet.getTab(documentHistoryLayout).setCaption(Translate.getMessage("documentHistoryCaption"));
    tabSheet.getTab(documentAccessLayout).setCaption(Translate.getMessage("documentAccessCaption"));
    btnAddPermission.setCaption(Translate.getMessage("btnAddPermission"));
    btnSave.setCaption(Translate.getMessage("btnSave"));

    document = HybridbpmUI.getDocumentAPI().getDocumentById(documentId, false);
    setCaption(document.getName());
    Design.read(this);
    documentFormLayout.initUI(document);
    documentHistoryLayout.setDocument(document);
    documentHistoryLayout.refreshTable();
    Responsive.makeResponsive(this);
    btnSave.setIcon(FontAwesome.SAVE);
    btnSave.addClickListener(this);
    btnAddPermission.setIcon(FontAwesome.PLUS);
    btnAddPermission.addClickListener(this);
    btnAddPermission.setVisible(false);
    tabSheet.addSelectedTabChangeListener(this);
    if (Objects.equals(Document.TYPE.FOLDER, document.getType())) {
        tabSheet.getTab(documentFormLayout).setCaption("Folder");
        tabSheet.getTab(documentHistoryLayout).setVisible(false);
    } else if (Objects.equals(Document.TYPE.FILE, document.getType())) {
        tabSheet.getTab(documentFormLayout).setCaption("File");
        tabSheet.getTab(documentHistoryLayout).setVisible(true);
    }
    if (HybridbpmUI.getDocumentAPI().getMyDocumentPermissions(document).contains(Permission.PERMISSION.PERMISSIONS)){
        documentAccessLayout.setDocument(document);
        documentAccessLayout.refreshTable();
        tabSheet.getTab(documentAccessLayout).setVisible(true);
    } else {
        tabSheet.getTab(documentAccessLayout).setVisible(false);
    }
}
项目:Vaadin-SignatureField    文件:DeclarativeTestBaseBase.java   
protected T read(String design) {
    try {
        return (T) Design.read(new ByteArrayInputStream(design
                .getBytes("UTF-8")));
    } catch (UnsupportedEncodingException e) {
        throw new RuntimeException(e);
    }
}
项目:Vaadin-SignatureField    文件:DeclarativeTestBaseBase.java   
protected String write(T object) {
    try {
        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        Design.write(object, outputStream);
        return outputStream.toString("UTF-8");
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
项目:vaadin-javaee-clinic-patient-queue-example    文件:DoctorComponentDesign.java   
public DoctorComponentDesign() {
    Design.read(this);
}
项目:vaadin-javaee-clinic-patient-queue-example    文件:RegistrationKioskDesign.java   
public RegistrationKioskDesign() {
    Design.read(this);
}
项目:vaadin-javaee-clinic-patient-queue-example    文件:InfoscreenDesign.java   
public InfoscreenDesign() {
    Design.read(this);
}
项目:vaadin-javaee-clinic-patient-queue-example    文件:DoctorsOfficeDesign.java   
public DoctorsOfficeDesign() {
    Design.read(this);
}
项目:VaadinSpringShiroMongoDB    文件:ProductFormDesign.java   
public ProductFormDesign() {
    Design.read(this);
}
项目:hybridbpm    文件:ErrorView.java   
public ErrorView() {
    Design.read(this);
    label.setValue(Translate.getMessage("page-not-found"));
}
项目:hybridbpm    文件:TaskConfigureCustomComponent.java   
public TaskConfigureCustomComponent() {
    Design.read(design);
    setCompositionRoot(design);
}
项目:hybridbpm    文件:ModuleLayout.java   
public ModuleLayout(Module module) {
        if (module == null) {
            this.module = new Module("", "", Module.MODULE_TYPE.DATA);
        } else {
            this.module = module;
            newModule = false;
        }
        Design.read(this);
        addComponent(titleTextField);
        for (FontAwesome fontAwesome : FontAwesome.values()) {
            iconComboBox.addItem(fontAwesome.name());
            iconComboBox.setItemIcon(fontAwesome.name(), fontAwesome);
            iconComboBox.setItemCaption(fontAwesome.name(), fontAwesome.name());
        }
        iconComboBox.setFilteringMode(FilteringMode.CONTAINS);

        for (Module m : HybridbpmUI.getDevelopmentAPI().getModuleListByType(Module.MODULE_TYPE.PROCESS, false)) {
            Item item = processComboBox.addItem(m.getName());
            processComboBox.setItemCaption(item, m.getTitle().getValue(HybridbpmUI.getCurrent().getLocale()));
            processComboBox.setItemIcon(item, FontAwesome.valueOf(m.getIcon()));
        }

        subTypeOptionGroup.addItem(Module.MODULE_SUBTYPE.TASK_FORM);
        subTypeOptionGroup.setItemCaption(Module.MODULE_SUBTYPE.TASK_FORM, "Task");

        subTypeOptionGroup.addItem(Module.MODULE_SUBTYPE.TEMPLATED_FORM);
        subTypeOptionGroup.setItemCaption(Module.MODULE_SUBTYPE.TEMPLATED_FORM, "Templated");

        moduleTypeOptionGroup.addItem(Module.MODULE_TYPE.DATA);
        moduleTypeOptionGroup.setItemIcon(Module.MODULE_TYPE.DATA, FontAwesome.valueOf(Module.MODULE_TYPE.DATA.getIcon()));

        moduleTypeOptionGroup.addItem(Module.MODULE_TYPE.PROCESS);
        moduleTypeOptionGroup.setItemIcon(Module.MODULE_TYPE.PROCESS, FontAwesome.valueOf(Module.MODULE_TYPE.PROCESS.getIcon()));

        moduleTypeOptionGroup.addItem(Module.MODULE_TYPE.FORM);
        moduleTypeOptionGroup.setItemIcon(Module.MODULE_TYPE.FORM, FontAwesome.valueOf(Module.MODULE_TYPE.FORM.getIcon()));

        moduleTypeOptionGroup.addItem(Module.MODULE_TYPE.CHART);
        moduleTypeOptionGroup.setItemIcon(Module.MODULE_TYPE.CHART, IcoMoon.valueOf(Module.MODULE_TYPE.CHART.getIcon()));

//        moduleTypeOptionGroup.addItem(Module.MODULE_TYPE.MOBILE);
//        moduleTypeOptionGroup.setItemIcon(Module.MODULE_TYPE.MOBILE, FontAwesome.valueOf(Module.MODULE_TYPE.MOBILE.getIcon()));

        moduleTypeOptionGroup.addItem(Module.MODULE_TYPE.CONNECTOR);
        moduleTypeOptionGroup.setItemIcon(Module.MODULE_TYPE.CONNECTOR, FontAwesome.valueOf(Module.MODULE_TYPE.CONNECTOR.getIcon()));

//        moduleTypeOptionGroup.addItem(Module.MODULE_TYPE.SCSS);
//        moduleTypeOptionGroup.setItemIcon(Module.MODULE_TYPE.SCSS, FontAwesome.valueOf(Module.MODULE_TYPE.SCSS.getIcon()));

        // add listener after definition of option groups
        moduleTypeOptionGroup.addValueChangeListener(new ModuleTypeChangeListener());
        subTypeOptionGroup.addValueChangeListener(new SubTypeChangeListener());

        binder.setItemDataSource(this.module);
        binder.bind(name, "name");
        binder.bind(titleTextField, "title");
        binder.bind(iconComboBox, "icon");
        binder.bind(configurable, "configurable");
        binder.bind(publishable, "publishable");
        binder.bind(moduleTypeOptionGroup, "type");
        binder.bind(subTypeOptionGroup, "subType");
        binder.bind(templateComboBox, "templateName");
        binder.bind(processComboBox, "processName");
        binder.setBuffered(true);
        if (newModule){
            name.setEnabled(true); // do not edit name
            name.addTextChangeListener((FieldEvents.TextChangeEvent event) -> {
                name.setValue(HybridbpmCoreUtil.checkClassName(event.getText()));
            });
        } else {
            moduleTypeOptionGroup.setEnabled(false); // do not edit type
            name.setEnabled(false); // do not edit name
            moduleTypeOptionGroup.setEnabled(false); // do not edit name
            subTypeOptionGroup.setEnabled(false); // do not edit name
            processComboBox.setEnabled(false); // do not edit name
        }

    }