use of com.vaadin.ui.HorizontalLayout in project opennms by OpenNMS.
the class TopologyUI method getTabSheet.
/**
* Gets a {@link TabSheet} view for all widgets in this manager.
*
* @return TabSheet
*/
private Component getTabSheet(WidgetManager manager, WidgetContext widgetContext) {
// Use an absolute layout for the bottom panel
AbsoluteLayout bottomLayout = new AbsoluteLayout();
bottomLayout.setSizeFull();
tabSheet = new TabSheet();
tabSheet.setSizeFull();
for (IViewContribution viewContrib : manager.getWidgets()) {
// Create a new view instance
final Component view = viewContrib.getView(m_applicationContext, widgetContext);
try {
m_graphContainer.getSelectionManager().addSelectionListener((SelectionListener) view);
} catch (ClassCastException e) {
}
try {
((SelectionNotifier) view).addSelectionListener(m_graphContainer.getSelectionManager());
} catch (ClassCastException e) {
}
try {
m_graphContainer.addChangeListener((GraphContainer.ChangeListener) view);
} catch (ClassCastException e) {
}
// Icon can be null
tabSheet.addTab(view, viewContrib.getTitle(), viewContrib.getIcon());
// components to the tab bar
try {
Component[] extras = ((HasExtraComponents) view).getExtraComponents();
if (extras != null && extras.length > 0) {
// For any extra controls, add a horizontal layout that will float
// on top of the right side of the tab panel
final HorizontalLayout extraControls = new HorizontalLayout();
extraControls.setHeight(32, Unit.PIXELS);
extraControls.setSpacing(true);
// Add the extra controls to the layout
for (Component component : extras) {
extraControls.addComponent(component);
extraControls.setComponentAlignment(component, Alignment.MIDDLE_RIGHT);
}
// Add a TabSheet.SelectedTabChangeListener to show or hide the extra controls
tabSheet.addSelectedTabChangeListener(new SelectedTabChangeListener() {
private static final long serialVersionUID = 6370347645872323830L;
@Override
public void selectedTabChange(SelectedTabChangeEvent event) {
final TabSheet source = (TabSheet) event.getSource();
if (source == tabSheet) {
// If the first tab was selected...
if (source.getSelectedTab() == view) {
extraControls.setVisible(true);
} else {
extraControls.setVisible(false);
}
}
}
});
// Place the extra controls on the absolute layout
bottomLayout.addComponent(extraControls, "top:0px;right:5px;z-index:100");
}
} catch (ClassCastException e) {
}
view.setSizeFull();
}
// Add the tabsheet to the layout
bottomLayout.addComponent(tabSheet, "top: 0; left: 0; bottom: 0; right: 0;");
return bottomLayout;
}
use of com.vaadin.ui.HorizontalLayout in project opennms by OpenNMS.
the class SimulationModeEnabledPanelItemProvider method createComponent.
private Component createComponent() {
Label label = new Label("Simulation Mode Enabled");
label.setDescription("Simulation Mode is enabled");
label.setIcon(FontAwesome.EXCLAMATION_TRIANGLE);
label.addStyleName("warning");
HorizontalLayout layout = new HorizontalLayout();
layout.addComponent(label);
layout.addStyleName("simulation");
return layout;
}
use of com.vaadin.ui.HorizontalLayout in project opennms by OpenNMS.
the class SurveillanceViewDetailTable method getImageSeverityLayout.
/**
* Returns the image severity layout for the given content.
*
* @param content the content
* @return the label with the applied style
*/
protected HorizontalLayout getImageSeverityLayout(String content) {
HorizontalLayout horizontalLayout = new HorizontalLayout();
Label placeholder = new Label();
placeholder.addStyleName("placeholder");
horizontalLayout.addComponent(placeholder);
Label contentLabel = new Label(content);
contentLabel.addStyleName("content");
horizontalLayout.addComponent(contentLabel);
return horizontalLayout;
}
use of com.vaadin.ui.HorizontalLayout in project opennms by OpenNMS.
the class SystemDefChoiceField method initContent.
/* (non-Javadoc)
* @see com.vaadin.ui.CustomField#initContent()
*/
@Override
public Component initContent() {
HorizontalLayout layout = new HorizontalLayout();
layout.setSpacing(true);
layout.setWidth("100%");
layout.addComponent(oidType);
layout.addComponent(oidValue);
layout.setExpandRatio(oidValue, 1);
return layout;
}
use of com.vaadin.ui.HorizontalLayout in project opennms by OpenNMS.
the class DialogWindow method createMainArea.
private Layout createMainArea(final String description) {
HorizontalLayout layout = new HorizontalLayout();
layout.setSpacing(true);
layout.setMargin(true);
layout.setWidth(100, Unit.PERCENTAGE);
Label label = new Label(description, ContentMode.PREFORMATTED);
label.setWidth(100, Unit.PERCENTAGE);
layout.addComponent(label);
return layout;
}
Aggregations