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);
}
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);
}
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;
}
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;
}
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();
}
Aggregations