/** * This does the same thing as ITableLabelProvider.getColumnText. */ public String getColumnText(Object object, int columnIndex) { QName qname = (QName) object; switch (columnIndex) { case 0 : return toDisplayString(qname.getNamespaceURI()); case 1 : return toDisplayString(qname.getLocalPart()); default : StringBuffer sb = new StringBuffer(); sb.append(qname.getNamespaceURI()); sb.append("#"); //$NON-NLS-1$ sb.append(qname.getLocalPart()); return sb.toString(); } }
/** * This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc * --> */ public String getText(Object object) { String label = CommonEditResourceHandler.getString("_UI_QName_type"); //$NON-NLS-1$ if (((QName) object).getNamespaceURI() != null && (((QName) object).getLocalPart() != null)) { label = CommonEditResourceHandler.getString("_UI_QName_type") + " " + //$NON-NLS-1$ //$NON-NLS-2$ ((QName) object).getNamespaceURI() + "#" + ((QName) object).getLocalPart(); //$NON-NLS-1$ } return label; }
/** * Performs the command activity required for the effect. The effect of calling * <code>execute</code> when <code>canExecute</code> returns <code>false</code>, or when * <code>canExecute</code> hasn't been called, is undefined. */ public void execute() { oldIsSet_ = eObject_.eIsSet(feature_); oldValue_ = eObject_.getNamespaceURI(); QNameHelper.setQNameNamespaceURI(eObject_, newValue_); if (nillable_ && newValue_ == null) eObject_.eUnset(feature_); }