Search in sources :

Example 66 with HorizontalLayout

use of com.vaadin.v7.ui.HorizontalLayout in project opencms-core by alkacon.

the class CmsGitToolOptionsPanel method addSelectableModule.

/**
 * Adds a check box and info widget for a module which should be selectable for check-in.<p>
 *
 * @param moduleName the name of the module
 */
public void addSelectableModule(final String moduleName) {
    boolean enabled = true;
    /* OpenCms.getModuleManager().hasModule(moduleName); */
    CheckBox moduleCheckBox = new CheckBox();
    String iconUri = CmsWorkplace.getResourceUri("tools/modules/buttons/modules.png");
    CmsResourceInfo info = new CmsResourceInfo(moduleName, "", iconUri);
    HorizontalLayout line = new HorizontalLayout();
    line.setWidth("100%");
    line.addComponent(moduleCheckBox);
    info.setWidth("100%");
    line.addComponent(info);
    line.setComponentAlignment(moduleCheckBox, Alignment.MIDDLE_CENTER);
    line.setExpandRatio(info, 1.0f);
    moduleCheckBox.setEnabled(true);
    // If enabled, then checked by default
    moduleCheckBox.setValue(Boolean.valueOf(enabled));
    m_moduleCheckboxes.put(moduleName, moduleCheckBox);
    m_moduleSelectionContainer.addComponent(line, m_moduleSelectionContainer.getComponentCount() - 1);
    setTab(m_dialogTab);
}
Also used : CmsResourceInfo(org.opencms.ui.components.CmsResourceInfo) CheckBox(com.vaadin.v7.ui.CheckBox) HorizontalLayout(com.vaadin.v7.ui.HorizontalLayout)

Example 67 with HorizontalLayout

use of com.vaadin.v7.ui.HorizontalLayout in project opencms-core by alkacon.

the class CmsMessageBundleEditorOptions method initUpperLeftComponent.

/**
 * Initializes the upper left component. Does not show the mode switch.
 */
private void initUpperLeftComponent() {
    m_upperLeftComponent = new HorizontalLayout();
    m_upperLeftComponent.setHeight("100%");
    m_upperLeftComponent.setSpacing(true);
    m_upperLeftComponent.setDefaultComponentAlignment(Alignment.MIDDLE_RIGHT);
    m_upperLeftComponent.addComponent(m_languageSwitch);
    m_upperLeftComponent.addComponent(m_filePathLabel);
}
Also used : HorizontalLayout(com.vaadin.v7.ui.HorizontalLayout)

Example 68 with HorizontalLayout

use of com.vaadin.v7.ui.HorizontalLayout in project opencms-core by alkacon.

the class CmsMessageBundleEditorOptions method initLowerRightComponent.

/**
 * Initializes the lower right component {@link #m_lowerRightComponent}, with all its components, i.e.,
 * the "Add key" input field {@link #m_addKeyInput} and the "Add key" button.
 */
private void initLowerRightComponent() {
    initAddKeyInput();
    Component addKeyButton = createAddKeyButton();
    HorizontalLayout addKeyWrapper = new HorizontalLayout(addKeyButton);
    addKeyWrapper.setComponentAlignment(addKeyButton, Alignment.MIDDLE_CENTER);
    addKeyWrapper.setHeight("100%");
    addKeyWrapper.setWidth(CmsMessageBundleEditorTypes.OPTION_COLUMN_WIDTH_PX);
    FormLayout inputForm = new FormLayout(m_addKeyInput);
    inputForm.setWidth("100%");
    HorizontalLayout lowerRight = new HorizontalLayout();
    lowerRight.setWidth("100%");
    lowerRight.addComponent(inputForm);
    lowerRight.addComponent(addKeyWrapper);
    lowerRight.setExpandRatio(inputForm, 1f);
    m_lowerRightComponent = lowerRight;
}
Also used : FormLayout(com.vaadin.ui.FormLayout) Component(com.vaadin.ui.Component) HorizontalLayout(com.vaadin.v7.ui.HorizontalLayout)

Example 69 with HorizontalLayout

use of com.vaadin.v7.ui.HorizontalLayout in project opencms-core by alkacon.

the class CmsMessageBundleEditorOptions method initLowerLeftComponent.

/**
 * Initializes the lower left component {@link #m_lowerLeftComponent} with the correctly placed "Add key"-label.
 */
private void initLowerLeftComponent() {
    HorizontalLayout placeHolderLowerLeft = new HorizontalLayout();
    placeHolderLowerLeft.setWidth("100%");
    Label newKeyLabel = new Label(m_messages.key(Messages.GUI_CAPTION_ADD_KEY_0));
    newKeyLabel.setWidthUndefined();
    HorizontalLayout lowerLeft = new HorizontalLayout(placeHolderLowerLeft, newKeyLabel);
    lowerLeft.setWidth("100%");
    lowerLeft.setExpandRatio(placeHolderLowerLeft, 1f);
    m_lowerLeftComponent = lowerLeft;
}
Also used : Label(com.vaadin.v7.ui.Label) HorizontalLayout(com.vaadin.v7.ui.HorizontalLayout)

Example 70 with HorizontalLayout

use of com.vaadin.v7.ui.HorizontalLayout in project opencms-core by alkacon.

the class CmsHistoryDialog method openChildDialog.

/**
 * Replaces the contents of the window containing a given component with a basic dialog
 * consisting of a back button to restore the previous window state and another user provided widget.<p>
 *
 * @param currentComponent the component whose parent window's content should be replaced
 * @param newView the user supplied part of the new window content
 * @param newCaption the caption for the child dialog
 */
public static void openChildDialog(Component currentComponent, Component newView, String newCaption) {
    final Window window = CmsVaadinUtils.getWindow(currentComponent);
    final String oldCaption = window.getCaption();
    CmsBasicDialog dialog = new CmsBasicDialog();
    VerticalLayout vl = new VerticalLayout();
    dialog.setContent(vl);
    Button backButton = new Button(CmsVaadinUtils.getMessageText(Messages.GUI_CHILD_DIALOG_GO_BACK_0));
    HorizontalLayout buttonBar = new HorizontalLayout();
    buttonBar.addComponent(backButton);
    buttonBar.setMargin(true);
    vl.addComponent(buttonBar);
    vl.addComponent(newView);
    final Component oldContent = window.getContent();
    if (oldContent instanceof CmsBasicDialog) {
        List<CmsResource> infoResources = ((CmsBasicDialog) oldContent).getInfoResources();
        dialog.displayResourceInfo(infoResources);
        if (oldContent instanceof CmsHistoryDialog) {
            dialog.addButton(((CmsHistoryDialog) oldContent).createCloseButton());
        }
    }
    backButton.addClickListener(new ClickListener() {

        private static final long serialVersionUID = 1L;

        public void buttonClick(ClickEvent event) {
            window.setContent(oldContent);
            window.setCaption(oldCaption);
            window.center();
        }
    });
    window.setContent(dialog);
    window.setCaption(newCaption);
    window.center();
}
Also used : Window(com.vaadin.ui.Window) CmsBasicDialog(org.opencms.ui.components.CmsBasicDialog) ClickEvent(com.vaadin.ui.Button.ClickEvent) HorizontalLayout(com.vaadin.v7.ui.HorizontalLayout) CmsResource(org.opencms.file.CmsResource) Button(com.vaadin.ui.Button) VerticalLayout(com.vaadin.v7.ui.VerticalLayout) Component(com.vaadin.ui.Component) ClickListener(com.vaadin.ui.Button.ClickListener)

Aggregations

HorizontalLayout (com.vaadin.ui.HorizontalLayout)53 Button (com.vaadin.ui.Button)37 Label (com.vaadin.ui.Label)32 VerticalLayout (com.vaadin.ui.VerticalLayout)32 ComboBox (com.vaadin.v7.ui.ComboBox)29 I18nProperties (de.symeda.sormas.api.i18n.I18nProperties)29 CssStyles (de.symeda.sormas.ui.utils.CssStyles)29 Alignment (com.vaadin.ui.Alignment)28 ValoTheme (com.vaadin.ui.themes.ValoTheme)28 Captions (de.symeda.sormas.api.i18n.Captions)28 ButtonHelper (de.symeda.sormas.ui.utils.ButtonHelper)27 FacadeProvider (de.symeda.sormas.api.FacadeProvider)26 Strings (de.symeda.sormas.api.i18n.Strings)26 VaadinIcons (com.vaadin.icons.VaadinIcons)25 UserProvider (de.symeda.sormas.ui.UserProvider)25 ControllerProvider (de.symeda.sormas.ui.ControllerProvider)24 ComboBoxHelper (de.symeda.sormas.ui.utils.ComboBoxHelper)23 MenuBar (com.vaadin.ui.MenuBar)22 UserRight (de.symeda.sormas.api.user.UserRight)22 ViewModelProviders (de.symeda.sormas.ui.ViewModelProviders)22