use of com.vaadin.v7.ui.HorizontalLayout in project charts by vaadin.
the class ContainerWithLotsOfData method getChart.
@Override
protected Component getChart() {
HorizontalLayout lo = new HorizontalLayout();
ContainerDataSeries container = createContainer();
Component table = createTable(container.getVaadinContainer());
Component chart = createChart(container);
lo.addComponents(table);
lo.addComponent(chart);
table.setSizeFull();
chart.setSizeFull();
lo.setSizeFull();
lo.setExpandRatio(table, 1);
lo.setExpandRatio(chart, 5);
return lo;
}
use of com.vaadin.v7.ui.HorizontalLayout in project ANNIS by korpling.
the class FlatQueryBuilder method launch.
private void launch(QueryController cp) {
this.cp = cp;
rsc = new ReducingStringComparator();
mainLayout = new VerticalLayout();
// tracking lists for vertical nodes, edgeboxes and metaboxes
vnodes = new ArrayList<>();
eboxes = new ArrayList<>();
mboxes = new ArrayList<>();
spbox = null;
// buttons and checks
btGo = new Button(BUTTON_GO_LABEL, this);
btGo.setStyleName(ChameleonTheme.BUTTON_SMALL);
btClear = new Button(BUTTON_CLEAR_LABEL, this);
btClear.setStyleName(ChameleonTheme.BUTTON_SMALL);
btInitLanguage = new Button("Initialize", this);
btInitLanguage.setDescription(INFO_INIT_LANG);
btInitSpan = new Button("Initialize", this);
btInitSpan.setDescription(INFO_INIT_SPAN);
btInitMeta = new Button("Initialize", this);
btInitMeta.setDescription(INFO_INIT_META);
filtering = new NativeSelect("Filtering mechanisms");
filtering.setDescription(INFO_FILTER);
ReducingStringComparator rdc = new ReducingStringComparator();
Set mappings = rdc.getMappings().keySet();
int i;
for (i = 0; i < mappings.size(); i++) {
String mapname = (String) mappings.toArray()[i];
filtering.addItem(i);
filtering.setItemCaption(i, mapname);
}
filtering.addItem(i + 1);
filtering.setItemCaption(i + 1, "generic");
filtering.select(i + 1);
filtering.setNullSelectionAllowed(false);
filtering.setImmediate(true);
// language layout
language = new HorizontalLayout();
languagenodes = new HorizontalLayout();
language.addComponent(languagenodes);
language.addComponent(btInitLanguage);
language.setMargin(true);
language.setCaption(LANG_CAPTION);
language.addStyleName("linguistics-panel");
// span layout
span = new HorizontalLayout();
span.setSpacing(true);
span.addComponent(btInitSpan);
span.setMargin(true);
span.setCaption(SPAN_CAPTION);
span.addStyleName("span-panel");
// meta layout
meta = new HorizontalLayout();
meta.setSpacing(true);
meta.addComponent(btInitMeta);
meta.setMargin(true);
meta.setCaption(META_CAPTION);
meta.addStyleName("meta-panel");
// toolbar layout
toolbar = new HorizontalLayout();
toolbar.setSpacing(true);
toolbar.addComponent(btGo);
toolbar.addComponent(btClear);
toolbar.setMargin(true);
toolbar.setCaption(TOOLBAR_CAPTION);
toolbar.addStyleName("toolbar-panel");
// advanced
advanced = new HorizontalLayout();
advanced.setSpacing(true);
advanced.addComponent(filtering);
advanced.setMargin(true);
advanced.setCaption(ADVANCED_CAPTION);
advanced.addStyleName("advanced-panel");
// put everything on the layout
mainLayout.setSpacing(true);
mainLayout.addComponent(language);
mainLayout.addComponent(span);
mainLayout.addComponent(meta);
mainLayout.addComponent(toolbar);
mainLayout.addComponent(advanced);
setContent(mainLayout);
getContent().setWidth("100%");
getContent().setHeight("-1px");
}
use of com.vaadin.v7.ui.HorizontalLayout in project opencms-core by alkacon.
the class CmsCategorySelectField method initContent.
/**
* @see com.vaadin.ui.CustomField#initContent()
*/
@Override
protected Component initContent() {
HorizontalLayout main = new HorizontalLayout();
main.setWidth("100%");
main.setSpacing(true);
m_tree = new CmsCategoryTree();
m_tree.setWidth("100%");
m_tree.setHeight("34px");
m_tree.setDisplayOnly(true);
if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(super.getInternalValue())) {
setInternalValue(super.getInternalValue());
}
main.addComponent(m_tree);
main.setExpandRatio(m_tree, 2);
Button open = new Button("");
open.addStyleName(OpenCmsTheme.BUTTON_ICON);
open.setIcon(FontOpenCms.GALLERY);
open.addClickListener(new ClickListener() {
private static final long serialVersionUID = 1L;
public void buttonClick(ClickEvent event) {
openWindow();
}
});
main.addComponent(open);
return main;
}
use of com.vaadin.v7.ui.HorizontalLayout in project opencms-core by alkacon.
the class A_CmsEditUserGroupRoleDialog method init.
/**
* Init method.<p>
*/
protected void init() {
setHeightUndefined();
removeExistingTable(getLeftTableLayout());
removeExistingTable(getRightTableLayout());
final CmsAvailableRoleOrPrincipalTable table = new CmsAvailableRoleOrPrincipalTable(this);
if (getAvailableItemsIndexedContainer("caption", "icon").size() > 0) {
getRightTableLayout().addComponent(new FixedHeightPanel(table, ITEM_HEIGHT), 0);
} else {
getRightTableLayout().addComponent(new FixedHeightPanel(CmsVaadinUtils.getInfoLayout(getEmptyMessage()), ITEM_HEIGHT));
}
if (getItemsOfUserIndexedContainer("prop1", "prop2", "prop3").size() > 0) {
getLeftTableLayout().addComponent(new FixedHeightPanel(new CmsCurrentRoleOrPrincipalTable(this, m_cms, m_principal), ITEM_HEIGHT), 0);
} else {
getLeftTableLayout().addComponent(new FixedHeightPanel(CmsVaadinUtils.getInfoLayout(getEmptyMessage()), ITEM_HEIGHT));
}
TextField siteTableFilter = new TextField();
siteTableFilter.setIcon(FontOpenCms.FILTER);
siteTableFilter.setInputPrompt(Messages.get().getBundle(UI.getCurrent().getLocale()).key(Messages.GUI_EXPLORER_FILTER_0));
siteTableFilter.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
siteTableFilter.setWidth("200px");
siteTableFilter.addTextChangeListener(new TextChangeListener() {
private static final long serialVersionUID = 1L;
public void textChange(TextChangeEvent event) {
table.filterTable(event.getText());
}
});
if (getParentLayout().getComponent(0) instanceof TextField) {
getParentLayout().removeComponent(getParentLayout().getComponent(1));
getParentLayout().removeComponent(getParentLayout().getComponent(0));
}
HorizontalLayout caps = new HorizontalLayout();
caps.setSpacing(true);
caps.setWidth("100%");
caps.setHeight("30px");
caps.addComponent(new Label(getCurrentTableCaption()));
caps.addComponent(new Label(getAddCaptionText()));
getParentLayout().addComponent(caps, 0);
getParentLayout().addComponent(siteTableFilter, 0);
getParentLayout().setComponentAlignment(siteTableFilter, com.vaadin.ui.Alignment.TOP_RIGHT);
getParentLayout().setExpandRatio(getParentLayout().getComponent(2), 1);
}
use of com.vaadin.v7.ui.HorizontalLayout in project opencms-core by alkacon.
the class CmsAdditionalInfosDialog method submit.
/**
* Submit additional info to user.<p>
*/
protected void submit() {
if (m_userinfoNoEditGroup.getRows().size() != m_addInfoReadOnly.size()) {
List<String> currentKeys = getKeyListFromGroup(m_userinfoNoEditGroup);
for (String key : m_addInfoReadOnly.keySet()) {
if (!currentKeys.contains(key)) {
saveAddInfo(key, null);
}
}
}
for (I_CmsEditableGroupRow row : m_userinfoGroup.getRows()) {
String key = ((TextField) (((HorizontalLayout) row.getComponent()).getComponent(0))).getValue();
String value = ((TextField) (((HorizontalLayout) row.getComponent()).getComponent(1))).getValue();
saveAddInfo(key, value);
m_addInfoEditable.remove(key);
}
// Remaining items in list seem to be deleted by the user..
for (String key : m_addInfoEditable.keySet()) {
saveAddInfo(key, null);
}
try {
m_cms.writeUser(m_user);
} catch (CmsException e) {
LOG.error("Unable to write user.", e);
}
}
Aggregations