Example usage for com.google.gwt.event.logical.shared ValueChangeEvent fire

List of usage examples for com.google.gwt.event.logical.shared ValueChangeEvent fire

Introduction

In this page you can find the example usage for com.google.gwt.event.logical.shared ValueChangeEvent fire.

Prototype

public static <T> void fire(HasValueChangeHandlers<T> source, T value) 

Source Link

Document

Fires a value change event on all registered handlers in the handler manager.

Usage

From source file:org.artificer.ui.client.local.pages.ontologies.OntologyEditorTierItem.java

License:Apache License

/**
 * Called when the user clicks the Delete action.
 */
protected void onDelete() {
    ValueChangeEvent.fire(this, null);
}

From source file:org.artificer.ui.client.local.pages.ontologies.OntologyEditorTierItem.java

License:Apache License

/**
 * Called when the user clicks the Edit action.
 */// w  w  w. jav a2 s.com
protected void onEdit() {
    EditOntologyNodeDialog dialog = dialogFactory.get();
    dialog.init(getValue());
    dialog.addValueChangeHandler(new ValueChangeHandler<OntologyClassBean>() {
        @Override
        public void onValueChange(ValueChangeEvent<OntologyClassBean> event) {
            OntologyClassBean updatedValue = event.getValue();
            OntologyClassBean currentValue = getValue();
            currentValue.setId(updatedValue.getId());
            currentValue.setLabel(updatedValue.getLabel());
            currentValue.setComment(updatedValue.getComment());
            label.setText(createLabel(currentValue));
            ValueChangeEvent.fire(OntologyEditorTierItem.this, currentValue);
        }
    });
    dialog.show();
}

From source file:org.artificer.ui.client.local.pages.ontologies.OntologyEditorTierItem.java

License:Apache License

/**
 * @see com.google.gwt.user.client.ui.HasValue#setValue(java.lang.Object, boolean)
 *//*ww w.  j av  a 2  s  .  co  m*/
@Override
public void setValue(OntologyClassBean value, boolean fireEvents) {
    this.value = value;
    if (fireEvents) {
        ValueChangeEvent.fire(this, value);
    }
    this.label.setText(createLabel(value));
}

From source file:org.artificer.ui.client.local.pages.ontologies.OntologySummaryPanel.java

License:Apache License

/**
 * @see com.google.gwt.user.client.ui.HasValue#setValue(java.lang.Object, boolean)
 *///from w w w.  j  a  v a  2s.c  o  m
@Override
public void setValue(List<OntologySummaryBean> value, boolean fireEvents) {
    this.value = value;
    if (fireEvents) {
        ValueChangeEvent.fire(this, value);
    }
    items.clear();
    for (OntologySummaryBean ontologyClass : value) {
        OntologySummaryPanelItem item = createItem(ontologyClass);
        items.add(item);
    }
}

From source file:org.artificer.ui.client.local.pages.ontologies.OntologySummaryPanel.java

License:Apache License

/**
 * Creates an item from the given ontology class bean.
 * @param ontologyClass/*from   w  ww .  j  a va2  s  . c  om*/
 */
private OntologySummaryPanelItem createItem(OntologySummaryBean ontologyClass) {
    final OntologySummaryPanelItem item = itemFactory.get();
    item.addValueChangeHandler(new ValueChangeHandler<OntologySummaryBean>() {
        @Override
        public void onValueChange(ValueChangeEvent<OntologySummaryBean> event) {
            // If the event value is null, that means we should remove the item.
            if (event.getValue() == null) {
                removeItem(item);
            }
            ValueChangeEvent.fire(OntologySummaryPanel.this, OntologySummaryPanel.this.value);
        }
    });
    item.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            selectItem(item);
        }
    });
    item.setValue(ontologyClass);
    return item;
}

From source file:org.artificer.ui.client.local.pages.ontologies.OntologySummaryPanelItem.java

License:Apache License

/**
 * Called when the user clicks the Delete action.
 *///from  w  w w  .j a  v a  2s .c o  m
protected void onDelete() {
    final NotificationBean notificationBean = notificationService.startProgressNotification(
            i18n.format("ontology-deleting.title"), i18n.format("ontology-deleting.message"));
    ontologyService.delete(getValue().getUuid(), new IServiceInvocationHandler<Void>() {
        @Override
        public void onReturn(Void data) {
            notificationService.completeProgressNotification(notificationBean.getUuid(),
                    i18n.format("ontology-deleted.title"),
                    i18n.format("ontology-deleted.message", getValue().getId()));
            ValueChangeEvent.fire(OntologySummaryPanelItem.this, null);
        }

        @Override
        public void onError(Throwable error) {
            notificationService.completeProgressNotification(notificationBean.getUuid(),
                    i18n.format("ontology-deleted-error.title"), error);
        }
    });
}

From source file:org.artificer.ui.client.local.pages.ontologies.OntologySummaryPanelItem.java

License:Apache License

/**
 * @see com.google.gwt.user.client.ui.HasValue#setValue(java.lang.Object, boolean)
 *//*from  w w w.jav a 2s.  co  m*/
@Override
public void setValue(OntologySummaryBean value, boolean fireEvents) {
    this.value = value;
    if (fireEvents) {
        ValueChangeEvent.fire(this, value);
    }
    this.label.setText(createLabel(value));
}

From source file:org.artificer.ui.client.local.widgets.common.EditableInlineLabel.java

License:Apache License

/**
 * @see com.google.gwt.user.client.ui.HasValue#setValue(java.lang.Object, boolean)
 *//*from   ww  w  . ja  v a 2 s . c o  m*/
@Override
public void setValue(String value, boolean fireEvents) {
    this.setText(value);
    this.value = value;
    if (fireEvents) {
        ValueChangeEvent.fire(this, value);
    }
}

From source file:org.bonitasoft.console.client.view.FileUploadEditor.java

License:Open Source License

public void setValue(String aValue, boolean aFireEvents) {
    setValue(aValue);
    ValueChangeEvent.fire(FileUploadEditor.this, getValue());
}

From source file:org.bonitasoft.console.client.view.ListBoxEditor.java

License:Open Source License

public void setValue(String aValue, boolean aFireEvents) {
    setValue(aValue);
    ValueChangeEvent.fire(ListBoxEditor.this, getValue());
}