public void refresh() { if (elementWrapper != null) { nameText.removeModifyListener(this); nameText.setText(elementWrapper.getName()); nameText.addModifyListener(this); } }
/** Sets the text without triggering a dialog-changed event. */ public void setTextWithoutUpdate(String text) { fText = text; if (isOkToUse(fTextControl)) { fTextControl.removeModifyListener(fModifyListener); fTextControl.setText(text); fTextControl.addModifyListener(fModifyListener); } }
@Test public void testRemoveModifyListenerUnregistersUntypedEvents() { ModifyListener listener = mock(ModifyListener.class); text.addModifyListener(listener); text.removeModifyListener(listener); assertFalse(text.isListening(SWT.Modify)); }
private void removeListeners() { repositoryCombo.removePostSelectionChangedListener(repositoryListener); nameText.removeModifyListener(standardTextListener); descriptionText.removeModifyListener(standardTextListener); userText.removeModifyListener(standardTextListener); passwordText.removeModifyListener(standardTextListener); for (IRepositoryFactory f : dynamicControls.keySet()) { for (LabelText control : dynamicControls.get(f).values()) { control.removeModifyListener(standardTextListener); } } for (IRepositoryFactory f : dynamicChoices.keySet()) { for (LabelledCombo control : dynamicChoices.get(f).values()) { control.getCombo().removeModifyListener(standardTextListener); } } }
@Override public void dispose() { super.dispose(); if (!dynamicEnabled) return; Text text = getText(); if (!text.isDisposed()) { text.removeModifyListener(modifyListener); } }
/** {@inheritDoc} */ @Override public void refresh() { nameWidget.removeModifyListener(nameListener); final PictogramElement pe = getSelectedPictogramElement(); if (pe != null) { final EObject bo = (EObject) Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(pe); // the filter assured, that it is a node if (bo == null) return; bc = (node) bo; String value = ""; value = bc.getName(); nameWidget.setText(value == null ? "" : value); nameWidget.addModifyListener(nameListener); } }
protected void removeListeners() { if (modifyListener != null) { portText.removeModifyListener(modifyListener); } }
/** @param listener */ public void removeModifyListener(ModifyListener listener) { textControl.removeModifyListener(listener); }
protected void removeListeners() { if (modifyListener != null) { nameText.removeModifyListener(modifyListener); uriText.removeModifyListener(modifyListener); } }
private void updateText() { text.removeModifyListener(mListener); text.setText(description.getDisplay() != null ? description.getDisplay() : ""); text.addModifyListener(mListener); }