public void doActivate() { if (editpart.getExecutionMode() == ExecutionMode.RUN_MODE) { pvMap.clear(); final Map<StringProperty, PVValueProperty> pvPropertyMap = editpart.getWidgetModel().getPVMap(); for (final StringProperty sp : pvPropertyMap.keySet()) { if (sp.getPropertyValue() == null || ((String) sp.getPropertyValue()).trim().length() <= 0) { continue; } try { IPV pv = BOYPVFactory.createPV((String) sp.getPropertyValue(), isAllValuesBuffered); pvMap.put(sp.getPropertyID(), pv); WidgetPVListener pvListener = new WidgetPVListener(sp.getPropertyID()); pv.addListener(pvListener); pvListenerMap.put(sp.getPropertyID(), pvListener); } catch (Exception e) { OPIBuilderPlugin.getLogger() .log( Level.WARNING, "Unable to connect to PV:" + (String) sp.getPropertyValue(), e); //$NON-NLS-1$ } } } }
@Override public String[] getAllPVNames() { if (editpart.getWidgetModel().getPVMap().isEmpty()) return new String[] {""}; // $NON-NLS-1$ Set<String> result = new HashSet<String>(); for (StringProperty sp : editpart.getWidgetModel().getPVMap().keySet()) { if (sp.isVisibleInPropSheet() && !((String) sp.getPropertyValue()).trim().isEmpty()) result.add((String) sp.getPropertyValue()); } return result.toArray(new String[result.size()]); }