Example usage for com.google.gwt.event.dom.client FocusHandler FocusHandler

List of usage examples for com.google.gwt.event.dom.client FocusHandler FocusHandler

Introduction

In this page you can find the example usage for com.google.gwt.event.dom.client FocusHandler FocusHandler.

Prototype

FocusHandler

Source Link

Usage

From source file:org.opencms.acacia.client.widgets.CmsColorpickerWidget.java

License:Open Source License

/**
 * Constructs an CmsComboWidget with the in XSD schema declared configuration.<p>
 * @param config The configuration string given from OpenCms XSD.
 *///from   w w  w.j  a  va  2  s.c o m
public CmsColorpickerWidget(String config) {

    // All composites must call initWidget() in their constructors.
    m_panel.add(m_colorPicker);
    initWidget(m_panel);
    m_colorPicker.getColorfield().addStyleName(I_CmsWidgetsLayoutBundle.INSTANCE.widgetCss().colorPicker());
    m_colorPicker.getTextboxPanel()
            .addStyleName(I_CmsWidgetsLayoutBundle.INSTANCE.widgetCss().colorPickerValue());
    m_colorPicker.addValueChangeHandler(new ValueChangeHandler<String>() {

        public void onValueChange(ValueChangeEvent<String> event) {

            fireChangeEvent();

        }

    });
    m_colorPicker.getColorValueBox().addFocusHandler(new FocusHandler() {

        public void onFocus(FocusEvent event) {

            CmsDomUtil.fireFocusEvent(CmsColorpickerWidget.this);
        }
    });
}

From source file:org.opencms.acacia.client.widgets.CmsComboWidget.java

License:Open Source License

/**
 * Constructs an CmsComboWidget with the in XSD schema declared configuration.<p>
 *
 * @param config The configuration string given from OpenCms XSD.
 *///from  ww  w . j a v a2s.c  o m
public CmsComboWidget(String config) {

    parseConfiguration(config);

    m_comboBox.addStyleName(I_CmsWidgetsLayoutBundle.INSTANCE.widgetCss().selectBoxPanel());
    // add some styles to parts of the combobox.
    m_comboBox.getOpener().addStyleName(I_CmsWidgetsLayoutBundle.INSTANCE.widgetCss().selectBoxSelected());
    m_comboBox.getSelectorPopup().addStyleName(I_CmsWidgetsLayoutBundle.INSTANCE.widgetCss().selectBoxPopup());
    m_comboBox.getTextBox().addStyleName(I_CmsWidgetsLayoutBundle.INSTANCE.widgetCss().comboBoxInput());
    m_comboBox.getTextBox().addKeyUpHandler(new KeyUpHandler() {

        public void onKeyUp(KeyUpEvent arg0) {

            onkeyupevent();
        }
    });

    m_comboBox.addValueChangeHandler(new ValueChangeHandler<String>() {

        public void onValueChange(ValueChangeEvent<String> event) {

            fireChangeEvent();

        }

    });
    initWidget(m_comboBox);
    m_comboBox.getTextBox().addFocusHandler(new FocusHandler() {

        public void onFocus(FocusEvent event) {

            CmsDomUtil.fireFocusEvent(CmsComboWidget.this);
        }
    });
}

From source file:org.opencms.acacia.client.widgets.CmsFileWidget.java

License:Open Source License

/**
 * Constructs an CmsComboWidget with the in XSD schema declared configuration.<p>
 *
 * @param openerTitle the gallery opener title
 * @param config the widget configuration string
 *//*from  w  w w  . j  a va 2s .c o  m*/
public CmsFileWidget(String openerTitle, String config) {

    m_linkSelect = new CmsGalleryField(CmsGalleryConfigurationJSO.parseConfiguration(config), false);
    m_linkSelect.setGalleryOpenerTitle(openerTitle);
    m_linkSelect.addValueChangeHandler(new ValueChangeHandler<String>() {

        public void onValueChange(ValueChangeEvent<String> event) {

            fireChangeEvent();

        }
    });
    // All composites must call initWidget() in their constructors.
    initWidget(m_linkSelect);
    m_linkSelect.addFocusHandler(new FocusHandler() {

        public void onFocus(FocusEvent event) {

            CmsDomUtil.fireFocusEvent(CmsFileWidget.this);
        }
    });
}

From source file:org.opencms.acacia.client.widgets.CmsGalleryWidget.java

License:Open Source License

/**
 * Constructs an gallery widget with the in XSD schema declared configuration.<p>
 *
 * @param openerTitle the gallery opener title
 * @param config the widget configuration string
 * @param hasImage <code>true</code> if the widget should show an image preview
 * @param allowUploads states if the upload button should be enabled for this widget
 *//* w w w . ja  va  2  s  .c  o  m*/
public CmsGalleryWidget(String openerTitle, String config, boolean hasImage, boolean allowUploads) {

    m_linkSelect = new CmsGalleryField(CmsGalleryConfigurationJSO.parseConfiguration(config), allowUploads);
    m_linkSelect.setGalleryOpenerTitle(openerTitle);
    m_linkSelect.addValueChangeHandler(new ValueChangeHandler<String>() {

        public void onValueChange(ValueChangeEvent<String> event) {

            fireChangeEvent();

        }
    });
    // All composites must call initWidget() in their constructors.
    initWidget(m_linkSelect);
    m_linkSelect.addFocusHandler(new FocusHandler() {

        public void onFocus(FocusEvent event) {

            CmsDomUtil.fireFocusEvent(CmsGalleryWidget.this);
        }
    });
    m_linkSelect.setHasImage(hasImage);
    m_allowUploads = allowUploads;
}

From source file:org.opencms.acacia.client.widgets.CmsGroupWidget.java

License:Open Source License

/**
 * Creates a new display widget.<p>
 *
 * @param config The configuration string given from OpenCms XSD.
 *///w ww .  j  a  v  a 2s.c  om
public CmsGroupWidget(String config) {

    parseConfiguration(config);
    m_groupSelection = new CmsGroupSelection(null);
    m_groupSelection.setParameter(m_flags, m_ouFqn, m_userName);
    m_groupSelection.getTextAreaContainer()
            .addStyleName(I_CmsWidgetsLayoutBundle.INSTANCE.widgetCss().vfsInputBox());
    m_groupSelection.addValueChangeHandler(new ValueChangeHandler<String>() {

        public void onValueChange(ValueChangeEvent<String> event) {

            fireChangeEvent();

        }
    });
    initWidget(m_groupSelection);
    m_groupSelection.getTextAreaContainer().getTextBox().addFocusHandler(new FocusHandler() {

        public void onFocus(FocusEvent event) {

            CmsDomUtil.fireFocusEvent(CmsGroupWidget.this);
        }
    });
}

From source file:org.opencms.acacia.client.widgets.CmsImageGalleryWidget.java

License:Open Source License

/**
 * Constructs an CmsComboWidget with the in XSD schema declared configuration.<p>
 *
 * @param openerTitle the gallery opener title
 * @param config the widget configuration string
 *///from  ww  w . j a  va 2s  .c o m
public CmsImageGalleryWidget(String openerTitle, String config) {

    m_linkSelect = new CmsImageGalleryField(CmsGalleryConfigurationJSO.parseConfiguration(config), true);
    m_linkSelect.setGalleryOpenerTitle(openerTitle);
    m_linkSelect.addValueChangeHandler(new ValueChangeHandler<String>() {

        public void onValueChange(ValueChangeEvent<String> event) {

            fireChangeEvent();

        }
    });
    // All composites must call initWidget() in their constructors.
    initWidget(m_linkSelect);
    m_linkSelect.addFocusHandler(new FocusHandler() {

        public void onFocus(FocusEvent event) {

            CmsDomUtil.fireFocusEvent(CmsImageGalleryWidget.this);
        }
    });
}

From source file:org.opencms.acacia.client.widgets.CmsMultiSelectWidget.java

License:Open Source License

/**
 * Constructs an OptionalTextBox with the given caption on the check.<p>
 * @param config the configuration string.
 *//*from w ww .j  a  v a 2  s  .c  o m*/
public CmsMultiSelectWidget(String config) {

    FlowPanel main = new FlowPanel();
    m_scrollPanel = GWT.create(CmsScrollPanel.class);
    // add separate style to the panel.
    m_scrollPanel.addStyleName(I_CmsWidgetsLayoutBundle.INSTANCE.widgetCss().radioButtonPanel());

    if (config.contains(CONFIGURATION_REQUIRES_ACTIVATION)) {
        config = config.replace(CONFIGURATION_REQUIRES_ACTIVATION, "");
        m_requiresactivation = true;
    }
    CmsSelectConfigurationParser parser = new CmsSelectConfigurationParser(config);
    // generate a list of all radio button.
    m_defaultCheckBox = new LinkedList<CmsCheckBox>();
    m_checkboxes = new LinkedList<CmsCheckBox>();
    if (m_requiresactivation) {

        buildActivationButton();
        SimplePanel activation = new SimplePanel(m_activation);
        activation.addStyleName(I_CmsWidgetsLayoutBundle.INSTANCE.widgetCss().radioButtonPanel());
        activation.getElement().getStyle().setMarginBottom(5, Unit.PX);
        main.add(activation);
    }
    FocusHandler focusHandler = new FocusHandler() {

        public void onFocus(FocusEvent event) {

            CmsDomUtil.fireFocusEvent(CmsMultiSelectWidget.this);
        }
    };

    for (Map.Entry<String, String> entry : parser.getOptions().entrySet()) {
        CmsCheckBox checkbox = new CmsCheckBox(entry.getValue());
        checkbox.setInternalValue(entry.getKey());
        if (parser.getDefaultValues().contains(entry.getKey())) {
            m_defaultCheckBox.add(checkbox);
        }
        checkbox.addValueChangeHandler(new ValueChangeHandler<Boolean>() {

            public void onValueChange(ValueChangeEvent<Boolean> event) {

                fireChangeEvent();

            }

        });
        // add a separate style each checkbox .
        checkbox.addStyleName(I_CmsWidgetsLayoutBundle.INSTANCE.widgetCss().checkboxlabel());
        checkbox.getButton().addFocusHandler(focusHandler);
        m_checkboxes.add(checkbox);
        // add the checkbox to the panel.
        m_panel.add(checkbox);

    }
    // All composites must call initWidget() in their constructors.
    m_scrollPanel.add(m_panel);
    m_scrollPanel.setResizable(false);
    int height = (m_rowsToShow * 17);
    if (m_checkboxes.size() < m_rowsToShow) {
        height = (m_checkboxes.size() * 17);
    }
    m_scrollPanel.setDefaultHeight(height);
    m_scrollPanel.setHeight(height + "px");
    main.add(m_scrollPanel);
    initWidget(main);
    if (m_requiresactivation) {
        setAllCheckboxEnabled(false);
    }

}

From source file:org.opencms.acacia.client.widgets.CmsPasswordWidget.java

License:Open Source License

/**
 * Constructs an CmsComboWidget.<p>
 *///w  ww . j  ava 2s  . c om
public CmsPasswordWidget() {

    // All composites must call initWidget() in their constructors.
    m_mainPanel.add(m_passwordTextBox);
    initWidget(m_mainPanel);
    m_mainPanel.setStyleName(I_CmsWidgetsLayoutBundle.INSTANCE.widgetCss().passwordTextBox());
    m_passwordTextBox.addValueChangeHandler(new ValueChangeHandler<String>() {

        public void onValueChange(ValueChangeEvent<String> event) {

            fireChangeEvent();

        }

    });
    m_passwordTextBox.addFocusHandler(new FocusHandler() {

        public void onFocus(FocusEvent event) {

            CmsDomUtil.fireFocusEvent(CmsPasswordWidget.this);
        }
    });
}

From source file:org.opencms.acacia.client.widgets.CmsRadioSelectWidget.java

License:Open Source License

/**
 * Constructs an OptionalTextBox with the given caption on the check.<p>
 * @param config the configuration string.
 *//* ww  w . ja va  2 s .c om*/
public CmsRadioSelectWidget(String config) {

    // generate a list of all radio button.
    m_group = new CmsRadioButtonGroup();
    // move the list to the array of all radio button.
    m_radioButtons = parseConfiguration(config);
    // add separate style to the panel.
    m_scrollPanel.addStyleName(I_CmsWidgetsLayoutBundle.INSTANCE.widgetCss().radioButtonPanel());
    FocusHandler focusHandler = new FocusHandler() {

        public void onFocus(FocusEvent event) {

            CmsDomUtil.fireFocusEvent(CmsRadioSelectWidget.this);
        }
    };
    // iterate about all radio button.
    for (CmsRadioButton radiobutton : m_radioButtons) {
        // add a separate style each radio button.
        radiobutton.addStyleName(I_CmsWidgetsLayoutBundle.INSTANCE.widgetCss().radioButtonlabel());
        radiobutton.getRadioButton().addFocusHandler(focusHandler);
        // add the radio button to the panel.
        m_panel.add(radiobutton);
    }
    m_scrollPanel.add(m_panel);
    m_scrollPanel.setResizable(false);
    int lineHeight = CmsClientStringUtil.parseInt(I_CmsLayoutBundle.INSTANCE.constants().css().lineHeightBig());
    if (lineHeight <= 0) {
        lineHeight = 17;
    }
    int height = (m_rowsToShow * lineHeight);
    if (m_radioButtons.size() < m_rowsToShow) {
        height = (m_radioButtons.size() * lineHeight);
    }
    // account for padding
    height += 8;
    m_scrollPanel.setDefaultHeight(height);
    m_scrollPanel.setHeight(height + "px");
    initWidget(m_scrollPanel);
}

From source file:org.opencms.acacia.client.widgets.CmsVfsWidget.java

License:Open Source License

/**
 * Constructs an CmsComboWidget with the in XSD schema declared configuration.<p>
 * @param config the configuration string given from OpenCms XSD
 * @param type the mode in witch the widget should be started
 * @param icon the icon image CSS class//from   w  w  w. j  a va  2  s.  c o m
 */
public CmsVfsWidget(String config, String type, String icon) {

    m_config = config;
    m_linkSelect = new CmsVfsSelection(icon, type, m_config);
    m_linkSelect.getTextAreaContainer()
            .addStyleName(I_CmsWidgetsLayoutBundle.INSTANCE.widgetCss().vfsInputBox());
    m_linkSelect.addValueChangeHandler(new ValueChangeHandler<String>() {

        public void onValueChange(ValueChangeEvent<String> event) {

            fireChangeEvent();

        }
    });
    m_linkSelect.getTextAreaContainer().getTextBox().addFocusHandler(new FocusHandler() {

        public void onFocus(FocusEvent event) {

            CmsDomUtil.fireFocusEvent(CmsVfsWidget.this);
        }
    });
    initWidget(m_linkSelect);

}