public void propertyChange(PropertyChangeEvent e) { String propertyName = e.getPropertyName(); if (e.getPropertyName().equals(Action.NAME)) { String text = (String) e.getNewValue(); menuItem.setText(text); } else if (propertyName.equals("enabled")) { Boolean enabledState = (Boolean) e.getNewValue(); menuItem.setEnabled(enabledState.booleanValue()); } }
public void propertyChange(PropertyChangeEvent e) { String propertyName = e.getPropertyName(); if (e.getPropertyName().equals(Action.NAME)) { String text = (String) e.getNewValue(); menuItem.setText(text); } else if (propertyName.equals("enabled")) { // System.out.println("Debug:TextViewer: ActionChangedListener enabled"); Boolean enabledState = (Boolean) e.getNewValue(); menuItem.setEnabled(enabledState.booleanValue()); } }
public void propertyChange(PropertyChangeEvent e) { String prop = e.getPropertyName(); if (prop == JFileChooser.SELECTED_FILE_CHANGED_PROPERTY) { if (isShowing()) { loadImage((File) e.getNewValue()); repaint(); } } }
@Override public void propertyChange(final PropertyChangeEvent evt) { final String propertyName = evt.getPropertyName(); if (AquaFocusHandler.FRAME_ACTIVE_PROPERTY.equals(propertyName)) { final JTextComponent comp = ((JTextComponent) evt.getSource()); if (evt.getNewValue() == Boolean.TRUE) { setVisible(comp.hasFocus()); } else { setVisible(false); } if (getDot() != getMark()) comp.getUI().damageRange(comp, getDot(), getMark()); } }
/** * Notifies this instance about a change in the value of a property of a source which of interest * to this instance. For example, <tt>OneToOneCallPeerPanel</tt> updates its user * interface-related properties upon changes in the value of the {@link * CallContainer#PROP_FULL_SCREEN} property of its associated {@link #callRenderer}. * * @param ev a <tt>PropertyChangeEvent</tt> which identifies the source, the name of the property * and the old and new values */ public void propertyChange(PropertyChangeEvent ev) { if (CallContainer.PROP_FULL_SCREEN.equals(ev.getPropertyName())) updateViewFromModel(); }
public void propertyChange(PropertyChangeEvent e) { String strPropName = e.getPropertyName(); if (strPropName.equals(WGlobal.USER_CHANGE)) { String strName = (String) e.getNewValue(); String strAccount = null; VDetailArea objDetailArea = m_adminIF.getDetailArea1(); if (objDetailArea != null) strAccount = objDetailArea.getItemValue("itype"); if (strAccount == null) strAccount = ""; strAccount = strAccount.trim(); String strDir = getPathDir() + strName; if (this instanceof DisplayTemplate) { if (strAccount.equals(Global.IMGIF)) strDir = strDir + ".img"; else if (strAccount.equals(Global.WALKUPIF)) strDir = strDir + ".walkup"; } String strPath = FileUtil.openPath(strDir); boolean bDefaultFile = false; if (strPath == null) { strPath = FileUtil.openPath(getDefaultFile(strAccount)); bDefaultFile = true; } clear(this); layoutUIComponents(strPath, bDefaultFile); } else if (strPropName.indexOf(WGlobal.IMGDIR) >= 0) { String strName = (String) e.getNewValue(); StringTokenizer strTokenizer = new StringTokenizer(strPropName); String strInterface = null; boolean bDefaultFile = false; if (strTokenizer.hasMoreTokens()) strTokenizer.nextToken(); if (strTokenizer.hasMoreTokens()) strInterface = strTokenizer.nextToken(); if (strInterface == null) strInterface = ""; strInterface = strInterface.trim(); String strDir = getPathDir() + strName; if (this instanceof DisplayTemplate) { if (strInterface.equals(WGlobal.IMGDIR)) strDir = strDir + ".img"; else if (strInterface.equals(WGlobal.WALKUPDIR)) strDir = strDir + ".walkup"; } String strPath = FileUtil.openPath(strDir); if (strPath == null) { String strAccount = Global.WALKUPIF; if (strInterface.equals(WGlobal.IMGDIR)) strAccount = Global.IMGIF; else if (strInterface.equals(WGlobal.WALKUPDIR)) strAccount = Global.WALKUPIF; strPath = FileUtil.openPath(getDefaultFile(strAccount)); bDefaultFile = true; } clear(this); layoutUIComponents(strPath, bDefaultFile); } else if (strPropName.indexOf(WGlobal.SAVEUSER_NOERROR) >= 0) { Object objValue = e.getNewValue(); String strName = ""; if (objValue instanceof String) strName = (String) objValue; else if (objValue instanceof WItem) strName = ((WItem) objValue).getText(); VDetailArea objDetail = m_adminIF.getDetailArea1(); String strAccount = null; if (objDetail != null) strAccount = objDetail.getItemValue("itype"); if (strAccount == null) strAccount = ""; strAccount = strAccount.trim(); String strDir = getPathDir() + strName; if (this instanceof DisplayTemplate) { if (strAccount.equals(Global.IMGIF)) strDir = strDir + ".img"; else if (strAccount.equals(Global.WALKUPIF)) strDir = strDir + ".walkup"; } TextFieldValues objTxf = getTxfValues(); writeFile(strName, strDir, objTxf.getTxfLabel(), objTxf.getTxfValue()); } else if (strPropName.indexOf(WGlobal.DELETE_USER) >= 0) { clear(this); String strPath = FileUtil.openPath(getDefaultFile("")); layoutUIComponents(strPath, true); } }