/** @brief refresh contents of table */ private void _refresh() { table_.setVisible(false); nameText_.setText(currentPlugin_.getName()); oldText = currentPlugin_.getName(); viewer_.setInput(currentPlugin_); table_.setVisible(true); }
private void _setInput(GrxBasePlugin p) { if (p == null) { table_.setVisible(false); nameText_.setText(""); // $NON-NLS-1$ oldText = ""; } else if (p != currentPlugin_) { table_.setVisible(false); nameText_.setText(p.getName()); oldText = p.getName(); viewer_.setInput(p); table_.setVisible(true); } }
public void registerItemChange(GrxBaseItem item, int event) { switch (event) { case GrxPluginManager.FOCUSED_ITEM: if (currentPlugin_ != item) { if (currentPlugin_ != null) currentPlugin_.deleteObserver(this); _setInput(item); currentPlugin_ = item; currentPlugin_.addObserver(this); } break; case GrxPluginManager.REMOVE_ITEM: if (currentPlugin_ == item) { currentPlugin_.deleteObserver(this); _setInput(null); currentPlugin_ = null; } break; default: break; } }
private boolean isValidChangeValue(String key, String value) { GrxBasePlugin.ValueEditType editType = currentPlugin_.GetValueEditType(key); if (editType instanceof ValueEditText) { return true; } else if (editType instanceof ValueEditCombo) { String[] items = ((ValueEditCombo) editType).GetItems(); for (int idx = 0; idx < items.length; idx++) { if (items[idx].equals(value)) { return true; } } return false; } return false; }
public void shutdown() { manager_.removeItemChangeListener(this, GrxBaseItem.class); if (currentPlugin_ != null) currentPlugin_.deleteObserver(this); }
public void setUp() { if (currentPlugin_ != null) currentPlugin_.deleteObserver(this); currentPlugin_ = manager_.focusedItem(); _setInput(currentPlugin_); if (currentPlugin_ != null) currentPlugin_.addObserver(this); }