private String getPath() { if (editorSoFar != null) { return editorSoFar.getPath(); } else { return "<Root Object>"; } }
private String getPath() { if (editorSoFar != null) { return editorSoFar.getPath(); } else { return "<Root Object>"; } }
/** * For debugging use only. */ @Override public String toString() { return getPath() + " = " + getEditorType(); } }
/** * For debugging use only. */ @Override public String toString() { return getPath() + " = " + getEditorType(); } }
private EditorModel(EditorModel parent, JClassType editorType, EditorData subEditor, JClassType proxyType) throws UnableToCompleteException { logger = parent.logger.branch(TreeLogger.DEBUG, "Descending into " + subEditor.getPath()); this.compositeEditorIntf = parent.compositeEditorIntf; this.editorIntf = parent.editorIntf; this.editorType = editorType; this.editorSoFar = subEditor; this.isEditorIntf = parent.isEditorIntf; this.leafValueEditorIntf = parent.leafValueEditorIntf; this.oracle = parent.oracle; this.parentModel = parent; this.proxyType = proxyType; this.typeData = parent.typeData; editorData = calculateEditorData(); }
private EditorModel(EditorModel parent, JClassType editorType, EditorData subEditor, JClassType proxyType) throws UnableToCompleteException { logger = parent.logger.branch(TreeLogger.DEBUG, "Descending into " + subEditor.getPath()); this.compositeEditorIntf = parent.compositeEditorIntf; this.editorIntf = parent.editorIntf; this.editorType = editorType; this.editorSoFar = subEditor; this.isEditorIntf = parent.isEditorIntf; this.leafValueEditorIntf = parent.leafValueEditorIntf; this.oracle = parent.oracle; this.parentModel = parent; this.proxyType = proxyType; this.typeData = parent.typeData; editorData = calculateEditorData(); }
/** * @param accumulator * @param data * @throws UnableToCompleteException */ private void descendIntoSubEditor(List<EditorData> accumulator, EditorData data) throws UnableToCompleteException { EditorModel superModel = parentModel; while (superModel != null) { if (superModel.editorType.isAssignableFrom(data.getEditorType()) || data.getEditorType().isAssignableFrom(superModel.editorType)) { poison(cycleErrorMessage(data.getEditorType(), superModel.getPath(), data.getPath())); return; } superModel = superModel.parentModel; } if (data.isDelegateRequired()) { EditorModel subModel = new EditorModel(this, data.getEditorType(), data, calculateEditedType(logger, data.getEditorType())); accumulator.addAll(accumulator.indexOf(data) + 1, Arrays.asList(subModel.getEditorData())); poisoned |= subModel.poisoned; } }
/** * @param accumulator * @param data * @throws UnableToCompleteException */ private void descendIntoSubEditor(List<EditorData> accumulator, EditorData data) throws UnableToCompleteException { EditorModel superModel = parentModel; while (superModel != null) { if (superModel.editorType.isAssignableFrom(data.getEditorType()) || data.getEditorType().isAssignableFrom(superModel.editorType)) { poison(cycleErrorMessage(data.getEditorType(), superModel.getPath(), data.getPath())); return; } superModel = superModel.parentModel; } if (data.isDelegateRequired()) { EditorModel subModel = new EditorModel(this, data.getEditorType(), data, calculateEditedType(logger, data.getEditorType())); accumulator.addAll(accumulator.indexOf(data) + 1, Arrays.asList(subModel.getEditorData())); poisoned |= subModel.poisoned; } }
public EditorData build() throws UnableToCompleteException { if (data == null) { throw new IllegalStateException(); } try { data.editorExpression = (parent == null ? "" : (parent.getExpression() + ".")) + access.getExpresson(); data.path = (parent == null ? "" : (parent.getPath() + ".")) + access.getPath(); if (data.isCompositeEditor) { TreeLogger compositeLogger = logger.branch(TreeLogger.DEBUG, "Examining composite editor at " + data.path); JClassType subEditorType = EditorModel.calculateCompositeTypes(data.editorType)[1]; data.composedData = new Builder(compositeLogger).access( EditorAccess.root(subEditorType)).parent(data).build(); } return data; } finally { data = null; } }
public EditorData build() throws UnableToCompleteException { if (data == null) { throw new IllegalStateException(); } try { data.editorExpression = (parent == null ? "" : (parent.getExpression() + ".")) + access.getExpresson(); data.path = (parent == null ? "" : (parent.getPath() + ".")) + access.getPath(); if (data.isCompositeEditor) { TreeLogger compositeLogger = logger.branch(TreeLogger.DEBUG, "Examining composite editor at " + data.path); JClassType subEditorType = EditorModel.calculateCompositeTypes(data.editorType)[1]; data.composedData = new Builder(compositeLogger).access( EditorAccess.root(subEditorType)).parent(data).build(); } return data; } finally { data = null; } }
String path = editorData.getPath(); if (path.length() == 0) { continue;
logger.log(Type.DEBUG, "Going over Field: " + editorData); //$NON-NLS-1$ String path = editorData.getPath(); if (path.length() == 0) { continue;
/** * Writes the map of the owner Models */ private void writeOwnerModels() { logger.log(Type.DEBUG, "Starting to write OwnerModels"); //$NON-NLS-1$ sw.println(); sw.println("@Override"); //$NON-NLS-1$ sw.println("protected java.util.Map<String, org.ovirt.engine.ui.uicommonweb.models.Model> getOwnerModels() {"); //$NON-NLS-1$ sw.indent(); sw.println("java.util.Map<String, org.ovirt.engine.ui.uicommonweb.models.Model> regs = new java.util.HashMap<String, org.ovirt.engine.ui.uicommonweb.models.Model>();"); //$NON-NLS-1$ logger.log(Type.DEBUG, "Going over Editor Fields"); //$NON-NLS-1$ for (EditorData editorData : model.getEditorData()) { logger.log(Type.DEBUG, "Going over Field: " + editorData); //$NON-NLS-1$ String path = editorData.getPath(); if (path.length() == 0) { continue; } JClassType propertyOwnerType = eraseType(editorData.getPropertyOwnerType()); if (propertyOwnerType == listModelType || propertyOwnerType == entityModelType) { logger.log(Type.DEBUG, "Found owner Model Field: " + editorData); //$NON-NLS-1$ sw.println("regs.put(\"%s\", getObject()%s);", path, editorData.getBeanOwnerExpression()); //$NON-NLS-1$ } } sw.println("return regs;"); //$NON-NLS-1$ sw.outdent(); sw.println("}"); //$NON-NLS-1$ }