Java 类com.vaadin.ui.Panel 实例源码
项目:spring-boot-plugins-example
文件:VaadinUI.java
@Override
protected void init(VaadinRequest request) {
final VerticalLayout root = new VerticalLayout();
root.setSizeFull();
root.setMargin(true);
root.setSpacing(true);
setContent(root);
MHorizontalLayout horizontalLayout = new MHorizontalLayout();
for (MenuEntry menuEntry : menuEntries) {
horizontalLayout.addComponent(new MButton(menuEntry.getName(), event -> {
navigator.navigateTo(menuEntry.getNavigationTarget());
}));
}
root.addComponent(horizontalLayout);
springViewDisplay = new Panel();
springViewDisplay.setSizeFull();
root.addComponent(springViewDisplay);
root.setExpandRatio(springViewDisplay, 1.0f);
}
项目:spring-boot-vaadin-rabbitmq-pipeline-demo
文件:NavigatorUI.java
@Override
protected void init(VaadinRequest request) {
final VerticalLayout rootLayout = new VerticalLayout();
rootLayout.setSizeFull();
setContent(rootLayout);
final CssLayout navigationBar = new CssLayout();
navigationBar.addStyleName(ValoTheme.LAYOUT_COMPONENT_GROUP);
navigationBar.addComponent(createNavigationButton("Demo View (Default)",
Constants.VIEW_DEFAULT));
navigationBar.addComponent(createNavigationButton("Stream View",
Constants.VIEW_STREAM));
rootLayout.addComponent(navigationBar);
springViewDisplay = new Panel();
springViewDisplay.setSizeFull();
rootLayout.addComponent(springViewDisplay);
rootLayout.setExpandRatio(springViewDisplay, 1.0f);
}
项目:osc-core
文件:BaseDeploymentSpecWindow.java
@SuppressWarnings("serial")
protected Panel getOptionTable() {
this.optionTable = new Table();
this.optionTable.setPageLength(3);
this.optionTable.setSizeFull();
this.optionTable.setImmediate(true);
this.optionTable.addGeneratedColumn("Enabled", new CheckBoxGenerator());
this.optionTable.addContainerProperty("Name", String.class, null);
this.optionTable.addItemClickListener(new ItemClickListener() {
@Override
public void itemClick(ItemClickEvent event) {
optionTableClicked(event);
}
});
this.optionPanel = new Panel();
this.optionPanel.addStyleName(StyleConstants.FORM_PANEL);
this.optionPanel.setWidth(100, Sizeable.Unit.PERCENTAGE);
this.optionPanel.setContent(this.optionTable);
return this.optionPanel;
}
项目:osc-core
文件:ManageLayout.java
public ManageLayout(BackupServiceApi backupService, RestoreServiceApi restoreService,
ServerApi server, ValidationApi validator) {
super();
this.backupService = backupService;
this.validator = validator;
VerticalLayout backupContainer = new VerticalLayout();
VerticalLayout restoreContainer = new VerticalLayout();
DbRestorer restorer = new DbRestorer(restoreService, server, validator);
restorer.setSizeFull();
// Component to Backup Database
Panel bkpPanel = new Panel();
bkpPanel.setContent(createBackup());
backupContainer.addComponent(ViewUtil.createSubHeader("Backup Database", null));
backupContainer.addComponent(bkpPanel);
restoreContainer.addComponent(ViewUtil.createSubHeader("Restore Database", null));
restoreContainer.addComponent(restorer);
addComponent(backupContainer);
addComponent(restoreContainer);
}
项目:osc-core
文件:BaseDAWindow.java
protected Panel getAttributesPanel() {
this.sharedKey = new PasswordField();
this.sharedKey.setRequiredError("shared secret key cannot be empty");
this.sharedKey.setRequired(true);
// best show/hide this conditionally based on Manager type.
this.sharedKey.setValue("dummy1234");
this.attributes = new Table();
this.attributes.setPageLength(0);
this.attributes.setSelectable(true);
this.attributes.setSizeFull();
this.attributes.setImmediate(true);
this.attributes.addContainerProperty("Attribute Name", String.class, null);
this.attributes.addContainerProperty("Value", PasswordField.class, null);
this.attributes.addItem(new Object[] { "Shared Secret key", this.sharedKey }, new Integer(1));
// creating panel to store attributes table
this.attributePanel = new Panel("Common Appliance Configuration Attributes:");
this.attributePanel.addStyleName("form_Panel");
this.attributePanel.setWidth(100, Sizeable.Unit.PERCENTAGE);
this.attributePanel.setContent(this.attributes);
return this.attributePanel;
}
项目:garantia
文件:LoginUI.java
@Override
protected void init(VaadinRequest request) {
log.info("Levanto la pagina UI");
final VerticalLayout root = new VerticalLayout();
root.setSizeFull();
root.setMargin(true);
root.setSpacing(true);
setContent(root);
final Panel viewContainer = new Panel();
viewContainer.setSizeFull();
root.addComponent(viewContainer);
root.setExpandRatio(viewContainer, 1.0f);
Navigator navigator = new Navigator(this, viewContainer);
//Navigator navigator = new Navigator(this, this);
navigator.addProvider(viewProvider);
log.info("Termina de levantar la pagina UI");
}
项目:HomeWire-Server
文件:FlowViewPanel.java
public FlowViewPanel(FlowDTO flowDTO,
ConditionWidgetRepository conditionWidgetRepository,
ActionWidgetRepository actionWidgetRepository) {
this.flowDTO = flowDTO;
this.innerPanel = new Panel(flowDTO.getName());
this.conditionWidgetRepository = conditionWidgetRepository;
this.actionWidgetRepository = actionWidgetRepository;
StackPanel stackPanel = StackPanel.extend(innerPanel);
stackPanel.setToggleIconsEnabled(false);
stackPanel.close();
innerPanel.setContent(getPanelGrid());
setCompositionRoot(innerPanel);
}
项目:HomeWire-Server
文件:ConditionPanel.java
public ConditionPanel(ConditionDTO conditionDTO,
ConditionWidgetRepository conditionWidgetRepository,
Consumer<ConditionDTO> changeListener) {
this.conditionWidgetRepository = conditionWidgetRepository;
this.conditionDTO = conditionDTO;
this.mainPanel = new Panel("Condition");
this.mainTypeComboBox = new ComboBox("Type");
this.currentConditionWidget = conditionWidgetRepository
.getFactory(TypeViewDTO.ConditionTypes.ofConditionDto(conditionDTO))
.createWidget(conditionDTO);
currentConditionWidget.setChangeListener(changeListener);
this.changeListener = changeListener;
setupPanel();
setCompositionRoot(mainPanel);
setSizeUndefined();
}
项目:HomeWire-Server
文件:ActionPanel.java
public ActionPanel(ActionDTO actionDTO,
ActionWidgetRepository actionWidgetRepository,
Consumer<ActionDTO> changeListener) {
this.actionWidgetRepository = actionWidgetRepository;
this.actionDTO = actionDTO;
this.mainPanel = new Panel("Action");
this.mainTypeComboBox = new ComboBox("Type");
this.currentActionWidget = actionWidgetRepository
.getFactory(TypeViewDTO.ActionTypes.ofActionDto(actionDTO))
.createWidget(actionDTO);
currentActionWidget.setChangeListener(changeListener);
this.changeListener = changeListener;
setupPanel();
setCompositionRoot(mainPanel);
setSizeUndefined();
}
项目:HomeWire-Server
文件:StatisticView.java
private Component createSensorList() {
VerticalLayout listLayout = new VerticalLayout();
//listLayout.setWidth(25, Unit.PERCENTAGE);
deviceSetupService.getSensorDtosGroupedByType().forEach((groupName, sensorDTOS) -> {
VerticalLayout sensorList = new VerticalLayout();
sensorDTOS.forEach(sensorDTO -> {
CheckBox c = new CheckBox(sensorDTO.getName());
c.addValueChangeListener(event -> {
updateChart(sensorDTO.getType() + sensorDTO.getDevId(),
(Boolean) event.getProperty().getValue());
});
sensorList.addComponent(c);
});
Panel typePanel = new Panel(groupName.substring(0, 1).toUpperCase() + groupName.substring(1));
typePanel.setContent(sensorList);
listLayout.addComponent(typePanel);
});
return listLayout;
}
项目:vaadin-vertx-samples
文件:MovieDetailsWindow.java
private MovieDetailsWindow(final Movie movie, final Date startTime,
final Date endTime) {
addStyleName("moviedetailswindow");
Responsive.makeResponsive(this);
setCaption(movie.getTitle());
center();
setCloseShortcut(KeyCode.ESCAPE, null);
setResizable(false);
setClosable(false);
setHeight(90.0f, Unit.PERCENTAGE);
VerticalLayout content = new VerticalLayout();
content.setSizeFull();
setContent(content);
Panel detailsWrapper = new Panel(buildMovieDetails(movie, startTime,
endTime));
detailsWrapper.setSizeFull();
detailsWrapper.addStyleName(ValoTheme.PANEL_BORDERLESS);
detailsWrapper.addStyleName("scroll-divider");
content.addComponent(detailsWrapper);
content.setExpandRatio(detailsWrapper, 1f);
content.addComponent(buildFooter());
}
项目:dungeonstory-java
文件:ImageSelector.java
public ImageSelector() {
images = new LinkedList<DSImage>();
visibleImages = new HashMap<Integer, Image>();
loadedImages = new LinkedList<Image>();
mainPanel = new Panel();
imageLayout = new HorizontalLayout();
layout = new HorizontalLayout();
imageMaxWidth = 110;
imageMaxHeight = 110;
leftButton = new Button("<", e -> scrollLeft());
rightButton = new Button(">", e -> scrollRight());
leftButton.setEnabled(false);
rightButton.setEnabled(false);
}
项目:dungeonstory-java
文件:MultiColumnFormLayout.java
public MultiColumnFormLayout(int columns, String caption) {
if (columns < 1) {
throw new IllegalArgumentException("column number must be greater than 1");
}
hLayout = new HorizontalLayout();
hLayout.setWidth(100, Unit.PERCENTAGE);
for (int i = 0; i < columns; i++) {
FormLayout form = new FormLayout();
hLayout.addComponent(form, i);
}
if (caption != null) {
hLayout.setMargin(new MarginInfo(false, true));
Panel panel = new Panel(caption, hLayout);
setCompositionRoot(panel);
} else {
setCompositionRoot(hLayout);
}
}
项目:SecureBPMN
文件:DetailPanel.java
public DetailPanel() {
setSizeFull();
addStyleName(ExplorerLayout.STYLE_DETAIL_PANEL);
setMargin(true);
CssLayout cssLayout = new CssLayout(); // Needed for rounded corners
cssLayout.addStyleName(ExplorerLayout.STYLE_DETAIL_PANEL);
cssLayout.setSizeFull();
super.addComponent(cssLayout);
mainPanel = new Panel();
mainPanel.addStyleName(Reindeer.PANEL_LIGHT);
mainPanel.setSizeFull();
cssLayout.addComponent(mainPanel);
// Use default layout
VerticalLayout verticalLayout = new VerticalLayout();
verticalLayout.setWidth(100, UNITS_PERCENTAGE);
verticalLayout.setMargin(true);
mainPanel.setContent(verticalLayout);
}
项目:demo-spring-vaadin
文件:MyVaadinUI.java
private void initLayout() {
final VerticalLayout root = new VerticalLayout();
root.setSizeFull();
root.setMargin(true);
root.setSpacing(true);
setContent(root);
final CssLayout navigationBar = new CssLayout();
navigationBar.addStyleName(ValoTheme.LAYOUT_COMPONENT_GROUP);
navigationBar.addComponent(createNavigationButton("Default View",
DefaultView.VIEW_NAME));
navigationBar.addComponent(createNavigationButton("MongoDB View",
MongoDBUIView.VIEW_NAME));
navigationBar.addComponent(createNavigationButton("Combobox Example View",
CityComboboxView.VIEW_NAME));
root.addComponent(navigationBar);
springViewDisplay = new Panel();
springViewDisplay.setSizeFull();
root.addComponent(springViewDisplay);
root.setExpandRatio(springViewDisplay, 1.0f);
}
项目:cherry-web
文件:SimplePageLayout.java
public SimplePageLayout(CaoNode res) {
this.res = res;
p = new Panel();
un = new Panel();
h = new HorizontalLayout();
v = new VerticalLayout();
p.setContent(v);
// setSizeFull();
h.setWidth("100%");
p.addStyleName("v-scrollable");
p.setHeight("100%");
un.addStyleName("v-scrollable");
un.setHeight("100%");
un.setWidth("250px");
addComponent(p);
addComponent(un);
setExpandRatio(p, 1);
}
项目:SecureBPMN
文件:ProfilePanel.java
protected void initInformationPanel() {
Panel infoPanel = new Panel();
infoPanel.addStyleName(Reindeer.PANEL_LIGHT);
infoPanel.setSizeFull();
profilePanelLayout.addComponent(infoPanel);
profilePanelLayout.setExpandRatio(infoPanel, 1.0f); // info panel should take all the remaining width available
// All the information sections are put under each other in a vertical layout
this.infoPanelLayout = new VerticalLayout();
infoPanel.setContent(infoPanelLayout);
initAboutSection();
initContactSection();
}
项目:minimal-j
文件:VaadinDialog.java
private static VaadinComponentWithWidth findComponentWithWidth(Component c) {
if (c instanceof VaadinComponentWithWidth) {
return (VaadinComponentWithWidth) c;
} else if (c instanceof Panel) {
Panel panel = (Panel) c;
return findComponentWithWidth(panel.getContent());
} else if (c instanceof ComponentContainer) {
ComponentContainer container = (ComponentContainer) c;
Iterator<Component> componentIterator = container.getComponentIterator();
while (componentIterator.hasNext()) {
VaadinComponentWithWidth componentWithWidth = findComponentWithWidth(componentIterator.next());
if (componentWithWidth != null) {
return componentWithWidth;
}
}
}
return null;
}
项目:holon-vaadin7
文件:AbstractDialog.java
/**
* Constructor
*/
public AbstractDialog() {
super();
// defaults
setModal(true);
setResizable(false);
setDraggable(false);
setClosable(false);
// style name
addStyleName("h-dialog");
// build
content = new Panel();
content.setWidth("100%");
content.addStyleName(ValoTheme.PANEL_BORDERLESS);
content.addStyleName("h-dialog-content");
actions = new HorizontalLayout();
actions.setWidth("100%");
actions.setSpacing(true);
actions.addStyleName(ValoTheme.WINDOW_BOTTOM_TOOLBAR);
actions.addStyleName("h-dialog-actions");
root = new VerticalLayout();
root.addComponent(content);
root.addComponent(actions);
setContent(root);
}
项目:osc-core
文件:MaintenanceView.java
private VerticalLayout createTab(String caption, String title, FormLayout content, String guid) {
VerticalLayout tabSheet = new VerticalLayout();
tabSheet.setCaption(caption);
tabSheet.setStyleName(StyleConstants.TAB_SHEET);
Panel panel = new Panel();
// creating subHeader inside panel
panel.setContent(content);
panel.setSizeFull();
tabSheet.addComponent(ViewUtil.createSubHeader(title, guid));
tabSheet.addComponent(panel);
return tabSheet;
}
项目:osc-core
文件:ArchiveLayout.java
public ArchiveLayout(ArchiveServiceApi archiveService, GetJobsArchiveServiceApi getJobsArchiveService,
UpdateJobsArchiveServiceApi updateJobsArchiveService) {
super();
VerticalLayout downloadContainer = new VerticalLayout();
VerticalLayout archiveContainer = new VerticalLayout();
// Component to Archive Jobs
JobsArchiverPanel archiveConfigurator = new JobsArchiverPanel(this, archiveService,
getJobsArchiveService, updateJobsArchiveService);
archiveConfigurator.setSizeFull();
archiveContainer.addComponent(ViewUtil.createSubHeader("Archive Jobs/Alerts", null));
archiveContainer.addComponent(archiveConfigurator);
downloadContainer.addComponent(ViewUtil.createSubHeader("Download Archive", null));
// Component to download archive
this.archiveTable = new Table();
this.archiveTable.setSizeFull();
this.archiveTable.setPageLength(5);
this.archiveTable.setImmediate(true);
this.archiveTable.addContainerProperty("Name", String.class, null);
this.archiveTable.addContainerProperty("Date", Date.class, null);
this.archiveTable.addContainerProperty("Size", Long.class, null);
this.archiveTable.addContainerProperty("Download", Link.class, null);
this.archiveTable.addContainerProperty("Delete", Button.class, null);
buildArchivesTable();
Panel archiveTablePanel = new Panel();
archiveTablePanel.setContent(this.archiveTable);
addComponent(archiveContainer);
addComponent(archiveTablePanel);
}
项目:osc-core
文件:InternalCertReplacementUploader.java
@Override
protected void layout(Panel panel) {
Label warningLabel = new Label(getString(KEYPAIR_UPLOAD_WARN_RESTART));
this.verLayout.addComponent(warningLabel);
super.layout(panel);
}
项目:osc-core
文件:SslConfigurationLayout.java
public SslConfigurationLayout(DeleteSslCertificateServiceApi deleteSslCertificate,
ListSslCertificatesServiceApi listSslCertificateService,
X509TrustManagerApi trustManager, BundleContext ctx) {
super();
this.deleteSslCertificateService = deleteSslCertificate;
this.listSslCertificateService = listSslCertificateService;
SslCertificateUploader certificateUploader = new SslCertificateUploader(trustManager);
VerticalLayout sslUploadContainer = makeSslUploadContainer(certificateUploader, getString(CERTIFICATE_UPLOAD_TITLE));
InternalCertReplacementUploader internalCertReplacementUploader = new InternalCertReplacementUploader(trustManager);
VerticalLayout sslReplaceInternalContainer = makeSslUploadContainer(internalCertReplacementUploader, getString(KEYPAIR_UPLOAD_TITLE));
VerticalLayout sslListContainer = new VerticalLayout();
sslListContainer.addComponent(createHeaderForSslList());
this.sslConfigTable = new Table();
this.sslConfigTable.setSizeFull();
this.sslConfigTable.setImmediate(true);
this.sslConfigTable.addContainerProperty("Alias", String.class, null);
this.sslConfigTable.addContainerProperty("SHA1 fingerprint", String.class, null);
this.sslConfigTable.addContainerProperty("Issuer", String.class, null);
this.sslConfigTable.addContainerProperty("Valid from", Date.class, null);
this.sslConfigTable.addContainerProperty("Valid until", Date.class, null);
this.sslConfigTable.addContainerProperty("Algorithm type", String.class, null);
this.sslConfigTable.addContainerProperty("Delete", Button.class, null);
this.sslConfigTable.setColumnWidth("Issuer", 200);
buildSslConfigurationTable();
Panel sslConfigTablePanel = new Panel();
sslConfigTablePanel.setContent(this.sslConfigTable);
sslListContainer.addComponent(sslConfigTablePanel);
addComponent(sslReplaceInternalContainer);
addComponent(sslUploadContainer);
addComponent(sslListContainer);
this.registration = ctx.registerService(TruststoreChangedListener.class, this, null);
}
项目:osc-core
文件:SslCertificateUploader.java
public SslCertificateUploader(X509TrustManagerApi x509TrustManager) {
this.x509TrustManager = x509TrustManager;
Panel panel = new Panel();
layout(panel);
setCompositionRoot(panel);
}
项目:osc-core
文件:SslCertificateUploader.java
protected void layout(Panel panel) {
createUpload();
this.verLayout.setSpacing(true);
panel.setWidth("100%");
panel.setContent(this.verLayout);
this.verLayout.addComponent(this.upload);
this.verLayout.addStyleName(StyleConstants.COMPONENT_SPACING);
}
项目:osc-core
文件:PluginView.java
private VerticalLayout createComponent(String caption, String title, FormLayout content, String guid) {
VerticalLayout tabSheet = new VerticalLayout();
Panel panel = new Panel();
// creating subHeader inside panel
panel.setContent(content);
panel.setSizeFull();
tabSheet.addComponent(ViewUtil.createSubHeader(title, guid));
tabSheet.addComponent(panel);
return tabSheet;
}
项目:osc-core
文件:BaseVCWindow.java
protected Panel providerPanel() {
this.providerPanel = new Panel();
this.providerPanel.setImmediate(true);
this.providerPanel.setCaption(OPENSTACK_CAPTION);
this.providerIP = new TextField("IP");
this.providerIP.setImmediate(true);
this.adminDomainId = new TextField("Admin Domain Id");
this.adminDomainId.setImmediate(true);
this.adminProjectName = new TextField("Admin Project Name");
this.adminProjectName.setImmediate(true);
this.providerUser = new TextField("User Name");
this.providerUser.setImmediate(true);
this.providerPW = new PasswordField("Password");
this.providerPW.setImmediate(true);
// adding not null constraint
this.adminDomainId.setRequired(true);
this.adminDomainId.setRequiredError(this.providerPanel.getCaption() + " Admin Domain Id cannot be empty");
this.adminProjectName.setRequired(true);
this.adminProjectName.setRequiredError(this.providerPanel.getCaption() + " Admin Project Name cannot be empty");
this.providerIP.setRequired(true);
this.providerIP.setRequiredError(this.providerPanel.getCaption() + " IP cannot be empty");
this.providerUser.setRequired(true);
this.providerUser.setRequiredError(this.providerPanel.getCaption() + " User Name cannot be empty");
this.providerPW.setRequired(true);
this.providerPW.setRequiredError(this.providerPanel.getCaption() + " Password cannot be empty");
FormLayout providerFormPanel = new FormLayout();
providerFormPanel.addComponent(this.providerIP);
providerFormPanel.addComponent(this.adminDomainId);
providerFormPanel.addComponent(this.adminProjectName);
providerFormPanel.addComponent(this.providerUser);
providerFormPanel.addComponent(this.providerPW);
this.providerPanel.setContent(providerFormPanel);
return this.providerPanel;
}
项目:osc-core
文件:BaseDAWindow.java
/**
* @return AZ Panel
*/
@SuppressWarnings("serial")
protected Panel getVirtualSystemPanel() {
try {
this.vsTable = new Table();
this.vsTable.setPageLength(5);
this.vsTable.setImmediate(true);
this.vsTable.addGeneratedColumn("Enabled", new CheckBoxGenerator());
this.vsTable.addItemClickListener(new ItemClickListener() {
@Override
public void itemClick(ItemClickEvent event) {
vsTableClicked((Long) event.getItemId());
}
});
// populating VS table
populateVirtualSystem();
Panel vsPanel = new Panel("Virtualization System:");
vsPanel.addStyleName("form_Panel");
vsPanel.setWidth(100, Sizeable.Unit.PERCENTAGE);
vsPanel.setContent(this.vsTable);
return vsPanel;
} catch (Exception e) {
log.error("Error while creating DA's VS panel", e);
}
return null;
}
项目:md-stepper
文件:VerticalStepper.java
private RowLayout(Step step) {
this.step = step;
label = getLabelProvider().getStepLabel(step);
divider = new CssLayout();
divider.addStyleName(STYLE_DIVIDER);
divider.setHeight(100, Unit.PERCENTAGE);
contentContainer = new Panel();
contentContainer.addStyleName(STYLE_CONTENT_CONTAINER);
contentContainer.addStyleName(ValoTheme.PANEL_BORDERLESS);
contentContainer.setSizeFull();
buttonBar = new HorizontalLayout();
buttonBar.addStyleName(STYLE_BUTTON_BAR);
buttonBar.setMargin(false);
buttonBar.setSpacing(true);
buttonBar.setWidth(100, Unit.PERCENTAGE);
buttonBar.setMargin(new MarginInfo(false, false, !isLastStep(step), false));
rootLayout = new GridLayout(2, 3);
rootLayout.setSizeFull();
rootLayout.setMargin(false);
rootLayout.setSpacing(false);
rootLayout.setColumnExpandRatio(1, 1);
rootLayout.setRowExpandRatio(1, 1);
rootLayout.addComponent(label, 0, 0, 1, 0);
rootLayout.addComponent(divider, 0, 1, 0, 2);
rootLayout.addComponent(contentContainer, 1, 1, 1, 1);
rootLayout.addComponent(buttonBar, 1, 2, 1, 2);
setCompositionRoot(rootLayout);
addStyleName(STYLE_COMPONENT);
setWidth(100, Unit.PERCENTAGE);
setActive(false);
}
项目:Persephone
文件:PersephoneUI.java
@Override
protected void init(VaadinRequest request) {
// Root layout
final VerticalLayout root = new VerticalLayout();
root.setSizeFull();
root.setSpacing(false);
root.setMargin(false);
setContent(root);
// Main panel
springViewDisplay = new Panel();
springViewDisplay.setSizeFull();
root.addComponent(springViewDisplay);
root.setExpandRatio(springViewDisplay, 1);
// Footer
Layout footer = getFooter();
root.addComponent(footer);
root.setExpandRatio(footer, 0);
// Error handler
UI.getCurrent().setErrorHandler(new UIErrorHandler());
// Disable session expired notification, the page will be reloaded on any action
VaadinService.getCurrent().setSystemMessagesProvider(
systemMessagesInfo -> {
CustomizedSystemMessages msgs = new CustomizedSystemMessages();
msgs.setSessionExpiredNotificationEnabled(false);
return msgs;
});
}
项目:holon-vaadin
文件:AbstractDialog.java
/**
* Constructor
*/
public AbstractDialog() {
super();
// defaults
setModal(true);
setResizable(false);
setDraggable(false);
setClosable(false);
// style name
addStyleName("h-dialog");
// build
content = new Panel();
content.setWidth("100%");
content.addStyleName(ValoTheme.PANEL_BORDERLESS);
content.addStyleName("h-dialog-content");
actions = new HorizontalLayout();
actions.setWidth("100%");
actions.setSpacing(true);
actions.addStyleName(ValoTheme.WINDOW_BOTTOM_TOOLBAR);
actions.addStyleName("h-dialog-actions");
root = new VerticalLayout();
root.addComponent(content);
root.addComponent(actions);
setContent(root);
}
项目:incubator-tamaya-sandbox
文件:ApplicationLayout.java
private void initLayouts() {
navBar = new NavBar(this);
// Use panel as main content container to allow it's content to scroll
content = new Panel();
content.setSizeFull();
content.addStyleName(UIConstants.PANEL_BORDERLESS);
addComponents(navBar, content);
setExpandRatio(content, 1);
}
项目:vaadin-medium-editor
文件:WindowEditorView.java
@Override
public Component getAddonComponent() {
Window w = new Window("Medium Editor in window");
w.setWidth(500, Unit.PIXELS);
w.setHeight(400, Unit.PIXELS);
Panel p = new Panel();
p.addStyleName(ValoTheme.PANEL_WELL);
p.setSizeFull();
MediumEditor editor = new MediumEditor();
editor.setSizeFull();
editor.setFocusOutlineEnabled(false);
editor.setJsLoggingEnabled(true);
editor.setContent(Lorem.getHtmlParagraphs(3, 5));
editor.configure(
editor.options()
.toolbar()
.buttons(Buttons.BOLD, Buttons.ITALIC,
Buttons.JUSTIFY_CENTER,
Buttons.ANCHOR)
.done()
.autoLink(true)
.imageDragging(false)
.done()
);
editors.add(editor);
p.setContent(editor);
w.setContent(p);
Button b = new Button("Open Window");
b.addClickListener(e -> {
w.setPosition(e.getClientX(), e.getClientY());
UI.getCurrent().addWindow(w);
});
return b;
}
项目:vaadin-medium-editor
文件:AddonDemoUI.java
private Component buildPreview() {
previewLabel = new Label();
previewLabel.setSizeFull();
Panel panel = new Panel(previewLabel);
panel.setCaption("Preview");
panel.setSizeFull();
panel.addStyleName(ValoTheme.PANEL_BORDERLESS);
panel.addStyleName("addon-code");
return panel;
}
项目:vaadin-medium-editor
文件:AddonDemoUI.java
private Component buildCode() {
codeLabel = new Label();
codeLabel.setContentMode(ContentMode.HTML);
Panel codePanel = new Panel(codeLabel);
codePanel.setSizeFull();
codePanel.addStyleName(ValoTheme.PANEL_BORDERLESS);
codePanel.addStyleName("addon-code");
return codePanel;
}
项目:vaadin-medium-editor
文件:AddonDemoUI.java
private Component buildMenu() {
Panel menuPanel = new Panel();
menuPanel.setSizeFull();
menuPanel.addStyleName(ValoTheme.PANEL_BORDERLESS);
menuPanel.addStyleName("addon-menu");
VerticalLayout vl = new VerticalLayout();
vl.setWidth(100, Unit.PERCENTAGE);
for (EditorStructure editorStructure : EditorStructure.values()) {
List<MenuItem> children = new ArrayList<>();
for (MenuItem i : menuItems) {
if (i.getType() == editorStructure) {
children.add(i);
}
}
Label section = new Label();
section.addStyleName(ValoTheme.LABEL_SUCCESS);
section.setSizeFull();
section.setValue(editorStructure.toString());
vl.addComponent(section);
for (MenuItem menuItem : children) {
Button b = new Button(menuItem.getLabel());
b.setSizeFull();
b.addClickListener(e -> {
getUI().getNavigator().navigateTo(menuItem.getViewName());
vl.forEach(c -> c.removeStyleName(ValoTheme.BUTTON_PRIMARY));
b.addStyleName(ValoTheme.BUTTON_PRIMARY);
});
vl.addComponent(b);
}
}
menuPanel.setContent(vl);
return menuPanel;
}
项目:kumoreg
文件:ReportWindow.java
private Panel buildReportPanel(String report) {
lblReport.setContentMode(ContentMode.HTML);
lblReport.setValue(report);
reportPanel.setContent(lblReport);
reportPanel.setWidth("100%");
reportPanel.setHeight("600");
lblReport.setHeightUndefined();
lblReport.setWidthUndefined();
return reportPanel;
}
项目:dungeonstory-java
文件:SummaryStep.java
private void showCharacterInfo() {
Messages messages = Messages.getInstance();
Character character = wizard.getCharacter();
if (character.getId() == null) {
FormLayout infoLayout = new FFormLayout().withMargin(true);
Panel infoPanel = new Panel(messages.getMessage("summaryStep.info.label"), infoLayout);
layout.addComponent(infoPanel);
File imageFile = new File(DSConstant.getImageDir() + character.getImage());
FileResource resource = new FileResource(imageFile);
Image image = new Image("Image", resource);
DSLabel nameLabel = new DSLabel(messages.getMessage("summaryStep.name.label"), character.getName());
DSLabel genderLabel = new DSLabel(messages.getMessage("summaryStep.sex.label"), character.getGender().toString());
DSLabel ageLabel = new DSLabel(messages.getMessage("summaryStep.age.label"), String.valueOf(character.getAge()));
DSLabel weightLabel = new DSLabel(messages.getMessage("summaryStep.weight.label"), character.getWeight() + " lbs");
DSLabel heightLabel = new DSLabel(messages.getMessage("summaryStep.height.label"), character.getHeight());
DSLabel alignmentLabel = new DSLabel(messages.getMessage("summaryStep.alignment.label"),
character.getAlignment().toString());
DSLabel regionLabel = new DSLabel(messages.getMessage("summaryStep.region.label"), character.getRegion().toString());
DSLabel backgroundLabel = new DSLabel(messages.getMessage("summaryStep.background.label"),
character.getBackground().getBackground().toString());
DSLabel goldLabel = new DSLabel(messages.getMessage("summaryStep.startingGold.label"), character.getGold());
infoLayout.addComponents(image, nameLabel, genderLabel, ageLabel, weightLabel, heightLabel, alignmentLabel,
regionLabel, backgroundLabel, goldLabel);
}
}
项目:dungeonstory-java
文件:ProficiencyList.java
public ProficiencyList(Character character) {
setSpacing(true);
CollectionToStringListConverter<Set<?>> setConverter = new CollectionToStringListConverter<Set<?>>();
Label proficiencyBonus = new Label("Bonus de maitrise : " + String.valueOf(character.getLevel().getProficiencyBonus()));
String armorProficiencies = setConverter.convertToPresentation(character.getArmorProficiencies(), new ValueContext());
HtmlLabel armorLabel = new HtmlLabel(StringUtils.defaultIfEmpty(armorProficiencies, "Aucune"));
Panel armorProficiencyPanel = new Panel("Armures", armorLabel);
String savingThrowProficiencies = setConverter.convertToPresentation(character.getSavingThrowProficiencies(), new ValueContext());
HtmlLabel savingThrowLabel = new HtmlLabel(StringUtils.defaultIfEmpty(savingThrowProficiencies, "Aucune"));
Panel savingThrowProficiencyPanel = new Panel("Jets de sauvegarde", savingThrowLabel);
String toolProficiencies = setConverter.convertToPresentation(character.getToolProficiencies(), new ValueContext());
HtmlLabel toolLabel = new HtmlLabel(StringUtils.defaultIfEmpty(toolProficiencies, "Aucune"));
Panel toolProficiencyPanel = new Panel("Outils", toolLabel);
String skillProficiencies = setConverter.convertToPresentation(character.getSkillProficiencies(), new ValueContext());
HtmlLabel skillLabel = new HtmlLabel(StringUtils.defaultIfEmpty(skillProficiencies, "Aucune"));
Panel skillProficiencyPanel = new Panel("Compétences", skillLabel);
setConverter.setNbColumns(2);
String weaponProficiencies = setConverter.convertToPresentation(character.getWeaponProficiencies(), new ValueContext());
HtmlLabel weaponLabel = new HtmlLabel(StringUtils.defaultIfEmpty(weaponProficiencies, "Aucune"));
Panel weaponProficiencyPanel = new Panel("Armes", weaponLabel);
addComponents(proficiencyBonus, armorProficiencyPanel, weaponProficiencyPanel, skillProficiencyPanel, savingThrowProficiencyPanel,
toolProficiencyPanel);
}
项目:businesshorizon2
文件:MethodViewImpl.java
private void initOptionGroups() {
detInput = new Panel("Zukünftige Perioden (deterministisch):");
deterministicInput.addItem(InputType.DIRECT);
deterministicInput.addItem(InputType.GESAMTKOSTENVERFAHREN);
deterministicInput.addItem(InputType.UMSATZKOSTENVERFAHREN);
detInput.addStyleName(Reindeer.PANEL_LIGHT);
detInput.addComponent(deterministicInput);
stoInput = new Panel("Vergangene Perioden (stochastisch):");
stochasticInput.addItem(InputType.DIRECT);
stochasticInput.addItem(InputType.GESAMTKOSTENVERFAHREN);
stochasticInput.addItem(InputType.UMSATZKOSTENVERFAHREN);
stoInput.addStyleName(Reindeer.PANEL_LIGHT);
stoInput.addComponent(stochasticInput);
}