use of com.vaadin.v7.ui.VerticalLayout in project opencms-core by alkacon.
the class CmsInfoButton method getLayout.
/**
* The layout which is shown in window by triggering onclick event of button.<p>
*
* @param htmlLines to be shown
* @param additionalElements further vaadin elements
* @return vertical layout
*/
protected VerticalLayout getLayout(final List<String> htmlLines, final List<InfoElementBean> additionalElements) {
VerticalLayout layout = new VerticalLayout();
Label label = new Label();
label.setWidthUndefined();
layout.setMargin(true);
label.setContentMode(ContentMode.HTML);
layout.addStyleName(OpenCmsTheme.INFO);
String htmlContent = "";
for (String line : htmlLines) {
htmlContent += line;
}
label.setValue(htmlContent);
layout.addComponent(label);
for (InfoElementBean infoElement : additionalElements) {
layout.addComponent(infoElement.getComponent(), infoElement.getPos());
}
layout.setWidthUndefined();
return layout;
}
use of com.vaadin.v7.ui.VerticalLayout in project opencms-core by alkacon.
the class CmsInfoButton method getClickListener.
/**
* Clicklistener for the button.<p>
*
* @param htmlLines to be shown in Label
* @param additionalElements to be placed in the verticalllayout which holds the label
* @return ClickListener
*/
private ClickListener getClickListener(final List<String> htmlLines, final List<InfoElementBean> additionalElements) {
return new Button.ClickListener() {
private static final long serialVersionUID = -553128629431329217L;
public void buttonClick(ClickEvent event) {
final Window window = CmsBasicDialog.prepareWindow(CmsBasicDialog.DialogWidth.content);
window.setCaption(m_windowCaption == null ? CmsVaadinUtils.getMessageText(Messages.GUI_INFO_BUTTON_CAPTION_0) : m_windowCaption);
window.setResizable(false);
CmsBasicDialog dialog = new CmsBasicDialog();
if (m_addButton != null) {
dialog.addButton(m_addButton, false);
}
VerticalLayout layout = getLayout(htmlLines, additionalElements);
dialog.setContent(layout);
Button button = new Button(CmsVaadinUtils.messageClose());
button.addClickListener(new Button.ClickListener() {
private static final long serialVersionUID = 5789436407764072884L;
public void buttonClick(ClickEvent event1) {
window.close();
}
});
dialog.addButton(button);
window.setContent(dialog);
UI.getCurrent().addWindow(window);
}
};
}
use of com.vaadin.v7.ui.VerticalLayout in project opencms-core by alkacon.
the class CmsVaadinUtils method getInfoLayout.
/**
* Creates a layout with info panel.<p>
*
* @param messageString Message to be displayed
* @return layout
*/
public static VerticalLayout getInfoLayout(String messageString) {
VerticalLayout ret = new VerticalLayout();
ret.setMargin(true);
ret.addStyleName("o-center");
ret.setWidth("100%");
VerticalLayout inner = new VerticalLayout();
inner.addStyleName("o-workplace-maxwidth");
Panel panel = new Panel();
panel.setWidth("100%");
Label label = new Label(CmsVaadinUtils.getMessageText(messageString));
label.addStyleName("o-report");
panel.setContent(label);
inner.addComponent(panel);
ret.addComponent(inner);
return ret;
}
use of com.vaadin.v7.ui.VerticalLayout in project opencms-core by alkacon.
the class CmsLoginUI method showLoginView.
/**
* Initializes the login view.<p>
*
* @param preselectedOu a potential preselected OU
*/
public void showLoginView(String preselectedOu) {
VerticalLayout content = new VerticalLayout();
content.setSizeFull();
m_targetOpener = new CmsLoginTargetOpener(A_CmsUI.get());
// content.setExpandRatio(m_targetOpener, 0f);
content.addComponent(m_loginForm);
content.setComponentAlignment(m_loginForm, Alignment.MIDDLE_CENTER);
content.setExpandRatio(m_loginForm, 1);
setContent(content);
m_loginForm.selectOrgUnit(preselectedOu);
}
use of com.vaadin.v7.ui.VerticalLayout in project opencms-core by alkacon.
the class CmsSourceSearchApp method getComponentForState.
/**
* @see org.opencms.ui.apps.A_CmsWorkplaceApp#getComponentForState(java.lang.String)
*/
@Override
protected Component getComponentForState(String state) {
m_rootLayout.setMainHeightFull(true);
HorizontalSplitPanel sp = new HorizontalSplitPanel();
sp.setSizeFull();
m_searchForm = new CmsSourceSearchForm(this);
sp.setFirstComponent(m_searchForm);
VerticalLayout result = new VerticalLayout();
result.setSizeFull();
m_infoIntroLayout = CmsVaadinUtils.getInfoLayout(Messages.GUI_SOURCESEARCH_INTRO_0);
m_infoEmptyResult = CmsVaadinUtils.getInfoLayout(Messages.GUI_SOURCESEARCH_EMPTY_0);
m_resultTable = new CmsFileTable(null);
result.addComponent(m_resultTable);
result.addComponent(m_infoEmptyResult);
result.addComponent(m_infoIntroLayout);
m_resultTable.setVisible(false);
m_infoEmptyResult.setVisible(false);
m_infoIntroLayout.setVisible(true);
m_resultTable.applyWorkplaceAppSettings();
m_resultTable.setContextProvider(new I_CmsContextProvider() {
/**
* @see org.opencms.ui.apps.I_CmsContextProvider#getDialogContext()
*/
public I_CmsDialogContext getDialogContext() {
CmsFileTableDialogContext context = new CmsFileTableDialogContext(CmsProjectManagerConfiguration.APP_ID, ContextType.fileTable, m_resultTable, m_resultTable.getSelectedResources());
storeCurrentFileSelection(m_resultTable.getSelectedResources());
context.setEditableProperties(CmsFileExplorer.INLINE_EDIT_PROPERTIES);
return context;
}
});
m_resultTable.setSizeFull();
if (m_resultTableFilter == null) {
m_resultTableFilter = new TextField();
m_resultTableFilter.setIcon(FontOpenCms.FILTER);
m_resultTableFilter.setInputPrompt(Messages.get().getBundle(UI.getCurrent().getLocale()).key(Messages.GUI_EXPLORER_FILTER_0));
m_resultTableFilter.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
m_resultTableFilter.setWidth("200px");
m_resultTableFilter.addTextChangeListener(new TextChangeListener() {
private static final long serialVersionUID = 1L;
public void textChange(TextChangeEvent event) {
m_resultTable.filterTable(event.getText());
}
});
m_infoLayout.addComponent(m_resultTableFilter);
}
sp.setSecondComponent(result);
sp.setSplitPosition(CmsFileExplorer.LAYOUT_SPLIT_POSITION, Unit.PIXELS);
if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(state)) {
CmsSearchReplaceSettings settings = getSettingsFromState(state);
if (settings != null) {
m_currentState = state;
m_searchForm.initFormValues(settings);
search(settings, false);
}
}
return sp;
}
Aggregations