Example usage for com.google.gwt.user.client.ui Widget setTitle

List of usage examples for com.google.gwt.user.client.ui Widget setTitle

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui Widget setTitle.

Prototype

public void setTitle(String title) 

Source Link

Document

Sets the title associated with this object.

Usage

From source file:org.nsesa.editor.gwt.dialog.client.ui.handler.move.AmendmentDialogMoveViewImpl.java

License:EUPL

@Inject
public AmendmentDialogMoveViewImpl(final ContentController contentController,
        final BeforeAfterActionBarController beforeAfterActionBarController) {

    this.contentView = contentController.getView();
    this.beforeActionBarView = beforeAfterActionBarController.getView();

    final Widget widget = uiBinder.createAndBindUi(this);
    initWidget(widget);/*from   ww  w. java  2  s  .c  om*/
    if (!GWT.isScript())
        widget.setTitle(this.getClass().getName());

    dockPanel.setHeight("100%");
    dockPanel.setWidth("100%");
    scrollPanel.setHeight("100%");
}

From source file:org.nsesa.editor.gwt.editor.client.ui.footer.FooterViewImpl.java

License:EUPL

@Inject
public FooterViewImpl() {
    final Widget widget = uiBinder.createAndBindUi(this);
    initWidget(widget);/*from  www  .ja v a  2  s  . co m*/
    if (!GWT.isScript())
        widget.setTitle(this.getClass().getName());

}

From source file:org.nsesa.editor.gwt.editor.client.ui.header.HeaderViewImpl.java

License:EUPL

@Inject
public HeaderViewImpl(final ClientFactory clientFactory) {
    this.clientFactory = clientFactory;
    final Widget widget = uiBinder.createAndBindUi(this);
    initWidget(widget);// w ww  .j  av a  2  s .  c om
    if (!GWT.isScript())
        widget.setTitle(this.getClass().getName());

    registerListeners();
}

From source file:org.nsesa.editor.gwt.editor.client.ui.main.EditorViewImpl.java

License:EUPL

@Inject
public EditorViewImpl(final ClientFactory clientFactory, final HeaderController headerController,
        final FooterController footerController) {
    this.clientFactory = clientFactory;
    this.headerView = headerController.getView();
    headerController.registerListeners();
    this.footerView = footerController.getView();
    final Widget widget = uiBinder.createAndBindUi(this);
    initWidget(widget);/*from www  . j a v  a 2  s .  c o  m*/
    if (!GWT.isScript())
        widget.setTitle(this.getClass().getName());

}

From source file:org.nsesa.editor.gwt.inline.client.ui.inline.InlineEditorViewImpl.java

License:EUPL

@Inject
public InlineEditorViewImpl(@Named("inlineRichTextEditor") RichTextEditor richTextEditor) {
    this.richTextEditor = richTextEditor;
    final Widget widget = uiBinder.createAndBindUi(this);
    initWidget(widget);/*from w  w  w . ja  v  a2  s .c o  m*/
    if (!GWT.isScript())
        widget.setTitle(this.getClass().getName());
}

From source file:org.opencms.acacia.client.CmsAttributeHandler.java

License:Open Source License

/**
 * Clears the error styles on the given tabbed panel.<p>
 *
 * @param tabbedPanel the tabbed panel/* w w  w.j a va2 s  . c  o m*/
 */
public static void clearErrorStyles(CmsTabbedPanel<?> tabbedPanel) {

    for (int i = 0; i < tabbedPanel.getTabCount(); i++) {
        Widget tab = tabbedPanel.getTabWidget(i);
        tab.setTitle(null);
        tab.getParent().removeStyleName(I_CmsLayoutBundle.INSTANCE.form().hasError());
        tab.getParent().removeStyleName(I_CmsLayoutBundle.INSTANCE.form().hasWarning());
    }
}

From source file:org.opencms.acacia.client.CmsAttributeHandler.java

License:Open Source License

/**
 * Sets the error message for the given value index.<p>
 *
 * @param valueIndex the value index//from   w  w  w . j a  v  a2s.  c o  m
 * @param message the error message
 * @param tabbedPanel the forms tabbed panel if available
 */
public void setErrorMessage(int valueIndex, String message, CmsTabbedPanel<?> tabbedPanel) {

    if (!m_attributeValueViews.isEmpty()) {
        FlowPanel parent = (FlowPanel) m_attributeValueViews.get(0).getParent();
        CmsAttributeValueView valueView = (CmsAttributeValueView) parent.getWidget(valueIndex);
        valueView.setErrorMessage(message);
        if (tabbedPanel != null) {
            int tabIndex = tabbedPanel.getTabIndex(valueView.getElement());
            if (tabIndex > -1) {
                Widget tab = tabbedPanel.getTabWidget(tabIndex);
                tab.setTitle("This tab has errors.");
                tab.getParent().removeStyleName(I_CmsLayoutBundle.INSTANCE.form().hasWarning());
                tab.getParent().addStyleName(I_CmsLayoutBundle.INSTANCE.form().hasError());
            }

        }
    }
}

From source file:org.opencms.acacia.client.CmsAttributeHandler.java

License:Open Source License

/**
 * Sets the warning message for the given value index.<p>
 *
 * @param valueIndex the value index/*from w ww  .  j  a  v  a2  s  .c o  m*/
 * @param message the warning message
 * @param tabbedPanel the forms tabbed panel if available
 */
public void setWarningMessage(int valueIndex, String message, CmsTabbedPanel<?> tabbedPanel) {

    if (!m_attributeValueViews.isEmpty()) {
        FlowPanel parent = (FlowPanel) m_attributeValueViews.get(0).getParent();
        CmsAttributeValueView valueView = (CmsAttributeValueView) parent.getWidget(valueIndex);
        valueView.setWarningMessage(message);
        if (tabbedPanel != null) {
            int tabIndex = tabbedPanel.getTabIndex(valueView.getElement());
            if (tabIndex > -1) {
                Widget tab = tabbedPanel.getTabWidget(tabIndex);
                tab.setTitle("This tab has warnings.");
                tab.getParent().addStyleName(I_CmsLayoutBundle.INSTANCE.form().hasWarning());
            }

        }
    }
}

From source file:org.opencms.gwt.client.ui.replace.CmsReplaceDialog.java

License:Open Source License

/**
 * Checks if the file suffix of the selected file matches the suffix of the resource to replace.<p>
 *//* w w w .j  a v a 2  s  .com*/
private void checkFileType() {

    if ((m_fileInput != null) && (m_replaceInfo != null) && (m_fileWidget != null)) {
        CmsFileInfo file = m_fileInput.getFiles()[0];
        if (!m_replaceInfo.getSitepath().endsWith(file.getFileSuffix())) {
            Widget warningImage = FontOpenCms.WARNING.getWidget(20,
                    I_CmsConstantsBundle.INSTANCE.css().colorWarning());
            warningImage.setTitle(Messages.get().key(Messages.GUI_REPLACE_WRONG_FILE_EXTENSION_0));
            warningImage.addStyleName(org.opencms.gwt.client.ui.css.I_CmsLayoutBundle.INSTANCE
                    .listItemWidgetCss().permaVisible());
            m_fileWidget.addButton(warningImage);
        }
    }
}

From source file:org.penpusher.client.ui.FormEntry.java

License:Open Source License

private Widget build(final FormElement element, final FormPanelModel model) {
    Widget widget = null;
    switch (element.getWidget()) {
    case TEXTFIELD:
        final TextBox txtBox = new TextBox();
        txtBox.setStyleName(style.textbox());
        // txtBox.setText(element.getDefaultValue());
        txtBox.addValueChangeHandler(new ValueChangeHandler<String>() {
            @Override/*www .j  a va  2 s . c  om*/
            public void onValueChange(final ValueChangeEvent<String> event) {
                model.setUpdated(true);
                element.setSelectedValue(txtBox.getText());
            }
        });
        widget = txtBox;
        break;
    case TEXTAREA:
        final TextArea txtArea = new TextArea();
        txtArea.setStyleName(style.textarea());
        // txtArea.setText(element.getDefaultValue());
        txtArea.addValueChangeHandler(new ValueChangeHandler<String>() {
            @Override
            public void onValueChange(final ValueChangeEvent<String> event) {
                model.setUpdated(true);
                element.setSelectedValue(txtArea.getText());
            }
        });
        widget = txtArea;
        break;
    case COMBOBOX:
        final ListBox listBox = new ListBox();
        listBox.setStyleName(style.listbox());
        for (final String value : element.getValues()) {
            listBox.addItem(value);
        }
        element.setSelectedValue(listBox.getItemText(0));
        listBox.addChangeHandler(new ChangeHandler() {
            @Override
            public void onChange(final ChangeEvent event) {
                model.setUpdated(true);
                final int index = listBox.getSelectedIndex();
                element.setSelectedValue(listBox.getItemText(index));
            }
        });
        widget = listBox;
        break;
    case DATE:
        final DateBox dateBox = createDateBox(element);
        dateBox.setStyleName(style.datebox());
        dateBox.addValueChangeHandler(new ValueChangeHandler<Date>() {

            @Override
            public void onValueChange(final ValueChangeEvent<Date> event) {
                model.setUpdated(true);
                final Date date = event.getValue();
                if (date != null) {
                    element.setSelectedValue(outputDateFormat.format(date));
                } else {
                    element.setSelectedValue(null);
                }
            }
        });
        // dateBox.getTextBox().addValueChangeHandler(new ValueChangeHandler<String>() {
        // @Override
        // public void onValueChange(final ValueChangeEvent<String> event) {
        // model.setUpdated(true);
        // final Date date = dateBox.getValue();
        // if (date != null) {
        // element.setSelectedValue(dateFormat.format(date));
        // }
        // else {
        // element.setSelectedValue(null);
        // }
        // }
        // });
        widget = dateBox;
        break;
    }
    if (widget != null && element.getDefaultValue() != null) {
        widget.setTitle("Sample: " + element.getDefaultValue());
    }
    return widget;
}