/** * Set the descriptor. * * @param newDescriptor */ private void setDescriptor(IPropertyDescriptor newDescriptor) { // if our descriptor is changing, we have to get rid // of our current editor if there is one if (descriptor != newDescriptor && editor != null) { editor.dispose(); editor = null; } descriptor = newDescriptor; }
/** * Set the descriptor. * * @param newDescriptor */ private void setDescriptor(IPropertyDescriptor newDescriptor) { // if our descriptor is changing, we have to get rid // of our current editor if there is one if (descriptor != newDescriptor && editor != null) { editor.dispose(); editor = null; } descriptor = newDescriptor; }
/** * Set the descriptor. * * @param newDescriptor */ private void setDescriptor(IPropertyDescriptor newDescriptor) { // if our descriptor is changing, we have to get rid // of our current editor if there is one if (descriptor != newDescriptor && editor != null) { editor.dispose(); editor = null; } descriptor = newDescriptor; }
public void disposeCellEditors() { // clean up old cell editors CellEditor[] oldCellEditors = getCellEditors(); if (oldCellEditors != null) { for (int i = 0; i < oldCellEditors.length; i++) { oldCellEditors[i].dispose(); } } }
/** * Disposes current cell editors */ protected void disposeCellEditors() { CellEditor[] cellEditors = getCellEditors(); if (cellEditors != null) { for (int i = 0; i < cellEditors.length; i++) { CellEditor editor = cellEditors[i]; if (editor != null) { editor.dispose(); } } } }
@Override public void dispose() { if (editor != null) { editor.dispose(); editor = null; } // recursive call to dispose children PropertySheetEntry[] entriesToDispose = childEntries; childEntries = null; if (entriesToDispose != null) { for (PropertySheetEntry element : entriesToDispose) { // an error in a property source may cause refreshChildEntries // to fail. Since the Workbench handles such errors we // can be left in a state where a child entry is null. if (element != null) { element.dispose(); } } } }
@Override public void dispose() { if (editor != null) { editor.dispose(); editor = null; } // recursive call to dispose children PropertySheetEntry[] entriesToDispose = childEntries; childEntries = null; if (entriesToDispose != null) { for (PropertySheetEntry element : entriesToDispose) { // an error in a property source may cause refreshChildEntries // to fail. Since the Workbench handles such errors we // can be left in a state where a child entry is null. if (element != null) { element.dispose(); } } } }
public void dispose() { if (editor != null) { editor.dispose(); editor = null; } // recursive call to dispose children PropertySheetEntry[] entriesToDispose = childEntries; childEntries = null; if (entriesToDispose != null) { for (int i = 0; i < entriesToDispose.length; i++) { // an error in a property source may cause refreshChildEntries // to fail. Since the Workbench handles such errors we // can be left in a state where a child entry is null. if (entriesToDispose[i] != null) { entriesToDispose[i].dispose(); } } } }
public void updatePropertyEditors() { CellEditor[] ce = propertiesViewer.getCellEditors(); int n = requiredProperties.size() + optionalProperties.size(); if(n == 0) { if(ce[KEY_INDEX] instanceof TextComboBoxCellEditor) { // if there was a combo editor previously defined, and the current // archetype has no properties, replace it with a plain text editor ce[KEY_INDEX].dispose(); ce[KEY_INDEX] = new TextCellEditor(propertiesTable, SWT.FLAT); } } else { TextComboBoxCellEditor comboEditor = null; // if there was a plain text editor previously defined, and the current // archetype has properties, replace it with a combo editor if(ce[KEY_INDEX] instanceof TextComboBoxCellEditor) { comboEditor = (TextComboBoxCellEditor) ce[KEY_INDEX]; } else { ce[KEY_INDEX].dispose(); comboEditor = new TextComboBoxCellEditor(propertiesTable, SWT.FLAT); ce[KEY_INDEX] = comboEditor; } // populate the property name selection List<String> propertyKeys = new ArrayList<String>(n); propertyKeys.addAll(requiredProperties); propertyKeys.addAll(optionalProperties); comboEditor.setItems(propertyKeys.toArray(new String[n])); } }
oldCellEditors[i].dispose();
fEditors[i].dispose();