com.vaadin.ui.Panel.addComponent()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(9.6k)|赞(0)|评价(0)|浏览(130)

本文整理了Java中com.vaadin.ui.Panel.addComponent()方法的一些代码示例,展示了Panel.addComponent()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Panel.addComponent()方法的具体详情如下:
包路径:com.vaadin.ui.Panel
类名称:Panel
方法名:addComponent

Panel.addComponent介绍

暂无

代码示例

代码示例来源:origin: org.activiti/activiti-explorer

/**
 * Add component to detail-container.
 */
public void addDetailComponent(Component c) {
 mainPanel.addComponent(c);
}

代码示例来源:origin: org.activiti/activiti-explorer

@Override
public void addComponent(Component c) {
  mainPanel.addComponent(c);
}

代码示例来源:origin: org.aperteworkflow/base-widgets

@Override
public void addChild(ProcessToolWidget child) {
  if (!(child instanceof ProcessToolVaadinRenderable)) {
    throw new IllegalArgumentException("child is not instance of " + ProcessToolVaadinRenderable.class.getName());
  }
  ProcessToolVaadinRenderable vChild = (ProcessToolVaadinRenderable) child;
  Component component = vChild.render();
  panel.addComponent(component);
}

代码示例来源:origin: de.mhus.lib/mhu-lib-vaadin6

protected void setContent(AbstractComponent c) {
  content.removeAllComponents();
  content.addComponent(c);
}

代码示例来源:origin: org.activiti/activiti-explorer

public void buttonClick(ClickEvent event) {
  // Remove button
  addSubTaskPanel.removeAllComponents();
  
  // And add textfield
  Label createSubTaskLabel = new Label("Create new subtask:");
  createSubTaskLabel.addStyleName(Reindeer.LABEL_SMALL);
  addSubTaskPanel.addComponent(createSubTaskLabel);
  newTaskTextField = new TextField();
  newTaskTextField.focus();
  addSubTaskPanel.addComponent(newTaskTextField);
 }
});

代码示例来源:origin: org.aperteworkflow/gui-commons

public static Panel panel(String title, com.vaadin.ui.Component... components) {
  Panel p = new Panel();
  p.setWidth(100, Sizeable.UNITS_PERCENTAGE);
  p.setCaption(title);
  for (com.vaadin.ui.Component c : components) {
    p.addComponent(c);
  }
  return p;
}

代码示例来源:origin: org.activiti/activiti-explorer

protected void initAddButton() {
 addSubTaskButton = new Button();
 addSubTaskButton.addStyleName(ExplorerLayout.STYLE_ADD);
 addSubTaskPanel.addComponent(addSubTaskButton);
 addSubTaskButton.addListener(new ClickListener() {
  public void buttonClick(ClickEvent event) {
   // Remove button
   addSubTaskPanel.removeAllComponents();
   
   // And add textfield
   Label createSubTaskLabel = new Label("Create new subtask:");
   createSubTaskLabel.addStyleName(Reindeer.LABEL_SMALL);
   addSubTaskPanel.addComponent(createSubTaskLabel);
   newTaskTextField = new TextField();
   newTaskTextField.focus();
   addSubTaskPanel.addComponent(newTaskTextField);
  }
 });
}

代码示例来源:origin: fi.vm.sade.organisaatio/organisaatio-ui-widgets

public OrganisaatioSearchPopup(OrganisaatioSearchTree orgSearch,List<String> oids) {
  orgSearchTree = orgSearch;
  orgSearchTree.init();
  orgSearchTree.reloadWithOids(oids);
  root = new Panel();
  root.setWidth(popupWidth);
  root.setHeight(popupHeight);
  root.addComponent(orgSearchTree); 
}

代码示例来源:origin: fi.vm.sade.organisaatio/organisaatio-ui-widgets

public OrganisaatioSearchPopup(OrganisaatioSearchTree orgSearch) {
  orgSearchTree = orgSearch;
  orgSearchTree.init();
  orgSearchTree.reload();
  root = new Panel();
  root.setWidth(popupWidth);
  root.setHeight(popupHeight);
  root.addComponent(orgSearchTree);
  
}

代码示例来源:origin: nz.co.senanque/madura-vaadinsupport

public void afterPropertiesSet() throws Exception {
  setSizeFull();
  Panel panel = new Panel();
  panel.setWidth("50%");
  panel.addComponent(new Label(getI18nHTML(), Label.CONTENT_XHTML));
  addComponent(panel);
  setComponentAlignment(panel, Alignment.MIDDLE_CENTER);
  m_OKButton = new Button("OK");
  panel.addComponent(m_OKButton);
  m_OKButton.addListener(new Button.ClickListener() {
    private static final long serialVersionUID = 1904763239654990140L;
    public void buttonClick(ClickEvent event) {
      getViewManager().popScreen();
      getViewManager().getMainWindow().requestRepaint();
    }
  });
}

代码示例来源:origin: org.activiti/activiti-explorer

protected void addHtmlContent(String html) {
 Panel panel = new Panel();
 panel.setWidth(800, UNITS_PIXELS);
 panel.setHeight(300, UNITS_PIXELS);
 
 content = new Label(html, Label.CONTENT_XHTML);
 content.setHeight(100, UNITS_PERCENTAGE);
 
 panel.addComponent(content);
 addComponent(panel);
}

代码示例来源:origin: org.aperteworkflow/base-widgets

@Override
public void addChild(ProcessToolWidget child) {
  if (!(child instanceof ProcessToolVaadinWidget)) {
    throw new IllegalArgumentException("child is not instance of " + ProcessToolVaadinWidget.class.getName());
  }
  Component component;
  ProcessToolVaadinWidget vChild = (ProcessToolVaadinWidget) child;
  try {
    component = vChild.render();
  } catch (Throwable e) {
    logger.log(Level.SEVERE, e.getMessage(), e);
    Panel p = new Panel();
    VerticalLayout vl = new VerticalLayout();
    vl.addComponent(new Label(getMessage("process.data.widget.exception-occurred")));
    vl.addComponent(new Label(e.getMessage()));
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    e.printStackTrace(new PrintWriter(baos));
    vl.addComponent(new Label("<pre>" + baos.toString() + "</pre>", CONTENT_XHTML));
    vl.addStyleName("error");
    p.addComponent(vl);
    p.setHeight("150px");
    component = p;
  }
  ts.addTab(component, getMessage(child.getAttributeValue("caption")), null);
  if (ts.getSelectedTab() == null)
    ts.setSelectedTab(component);
}

代码示例来源:origin: org.aperteworkflow/gui-commons

private void wrapWithModalWindow(Form form) {
  Panel panel = new Panel();
  panel.setWidth("800px");
  panel.setScrollable(true);
  panel.addComponent(form);
  setDetailsWindow(modalWindow(getMessage("dict.item"), panel));
}

代码示例来源:origin: fi.vm.sade.organisaatio/organisaatio-ui-widgets

private void initializeComponents() {
  root = new Panel();
  Layout horizontalLayout = new HorizontalLayout();
  searchField = new TextField();
  horizontalLayout.addComponent(searchField);
  searchField.setImmediate(true);
  searchField.addListener(new Property.ValueChangeListener() {
    @Override
    public void valueChange(Property.ValueChangeEvent valueChangeEvent) {
      searchTextChanged((String) searchField.getValue());
    }
  });
  root.addComponent(horizontalLayout);
  root.addComponent(organizationTree);
  organizationTree.setItemCaptionPropertyId("caption");
  organizationTree.setItemCaptionMode(Tree.ITEM_CAPTION_MODE_PROPERTY);
  organizationTree.setImmediate(true);
  addComponent(root);
}

代码示例来源:origin: org.aperteworkflow/editor

private void displaySelectedDictionary() {
  String dictionaryId = getCurrentDictionaryId();
  String languageCode = getCurrentLanguageCode();
  dictionaryLayout.removeAllComponents();
  if (dictionaryId != null && languageCode != null) {
    HorizontalLayout hl = new HorizontalLayout();
    hl.setSpacing(true);
    hl.addComponent(dictionaryNameField);
    hl.addComponent(dictionaryDescriptionField);
    HorizontalLayout hl2 = new HorizontalLayout();
    hl2.setSpacing(true);
    hl2.addComponent(editPermissionField);
    container = new BeanItemContainer<XmlDictionaryItemWrapper>(XmlDictionaryItemWrapper.class, processDictionaries.getItems(dictionaryId, languageCode));
    bindProperty(dictionaryNameField, getCurrentDictionary(), _DICTIONARY_NAME);
    bindProperty(dictionaryDescriptionField, getCurrentDictionary(), _DESCRIPTION);
    bindProperty(editPermissionField, getCurrentDictionary(), _EDIT_PERMISSION);
    dictionaryLayout.addComponent(hl);
    dictionaryLayout.addComponent(hl2);
    dictionaryLayout.addComponent(getAddEntryButton());
    dictionaryLayout.addComponent(builder.createTable(container));
  }
}

代码示例来源:origin: org.activiti/activiti-explorer

protected void addDropPanel() {
 Panel dropPanel = new Panel();
 DragAndDropWrapper dragAndDropWrapper = new DragAndDropWrapper(dropPanel);
 dragAndDropWrapper.setDropHandler(this);
 dragAndDropWrapper.setWidth("80%");
 addComponent(dragAndDropWrapper);
 setComponentAlignment(dragAndDropWrapper, Alignment.MIDDLE_CENTER);
 
 Label dropLabel = new Label(i18nManager.getMessage(Messages.UPLOAD_DROP));
 dropLabel.setSizeUndefined();
 dropPanel.addComponent(dropLabel);
 ((VerticalLayout)dropPanel.getContent()).setComponentAlignment(dropLabel, Alignment.MIDDLE_CENTER);
}

代码示例来源:origin: org.aperteworkflow/base-widgets

private Panel getInitedWidgetTreePanel() {
  widgetTree.setContainerDataSource(hierarchicalContainer);
  widgetTree.setDragMode(Tree.TreeDragMode.NODE);
  widgetTree.setItemCaptionPropertyId("name");
  widgetTree.setDropHandler(new TreeSortDropHandler(widgetTree, hierarchicalContainer));
  widgetTree.setWidth("100%");
  widgetTree.addShortcutListener(getDeleteShortcutListener());
  Panel panel = new Panel(getLocalizedMessage("widget-hierarchy"));
  panel.setHeight("340px");
  panel.setWidth("250px");
  panel.addComponent(widgetTree);
  return panel;
}

代码示例来源:origin: org.activiti/activiti-explorer

panelLayout.setSizeUndefined();
imagePanel.setContent(panelLayout);
imagePanel.addComponent(diagram);

代码示例来源:origin: org.activiti/activiti-explorer

textFieldPanel.addComponent(commentInputField);

代码示例来源:origin: org.aperteworkflow/editor

private VerticalLayout buildWidgetEditorTabContent() {
  I18NSource messages = I18NSource.ThreadUtil.getThreadI18nSource();
  VerticalLayout availableWidgetsLayout = new VerticalLayout();
  availableWidgetsLayout.setSpacing(true);
  availableWidgetsLayout.setWidth("100%");
  availableWidgetsLayout.addComponent(availableWidgetsPane);
  VerticalLayout stepLayout = new VerticalLayout();
  stepLayout.setWidth("100%");
  stepLayout.setSpacing(true);
  stepLayout.setMargin(true);
  stepLayout.addComponent(new Label(messages.getMessage("userstep.editor.widgets.instructions"), Label.CONTENT_XHTML));
  stepLayout.addComponent(availableWidgetsLayout);
  Panel treePanel = new Panel();
  treePanel.setStyleName(Reindeer.PANEL_LIGHT);
  treePanel.addComponent(stepTree);
  treePanel.setWidth("245px");
  HorizontalLayout treeAndParamLayout = new HorizontalLayout();
  treeAndParamLayout.setWidth("100%");
  treeAndParamLayout.setSpacing(true);
  treeAndParamLayout.addComponent(treePanel);
  treeAndParamLayout.addComponent(paramPanel);
  treeAndParamLayout.setExpandRatio(paramPanel, 1.0f);
  stepLayout.addComponent(treeAndParamLayout);
  stepLayout.setExpandRatio(treeAndParamLayout, 1.0f);
  return stepLayout;
}

相关文章