[Buix-commits] r1300 - in jaxx/trunk: jaxx-runtime-api/src/main/java/jaxx/runtime jaxx-runtime-swing/src/main/java/jaxx/runtime/swing/wizard jaxx-runtime-swing/src/main/resources/icons
Author: tchemit Date: 2009-04-08 03:26:10 +0000 (Wed, 08 Apr 2009) New Revision: 1300 Modified: jaxx/trunk/jaxx-runtime-api/src/main/java/jaxx/runtime/DataContext.java jaxx/trunk/jaxx-runtime-swing/src/main/java/jaxx/runtime/swing/wizard/WizardOperationModel.java jaxx/trunk/jaxx-runtime-swing/src/main/resources/icons/action-wizard-config-16.png jaxx/trunk/jaxx-runtime-swing/src/main/resources/icons/action-wizard-message-16.png jaxx/trunk/jaxx-runtime-swing/src/main/resources/icons/action-wizard-next-16.png jaxx/trunk/jaxx-runtime-swing/src/main/resources/icons/action-wizard-pause-16.png jaxx/trunk/jaxx-runtime-swing/src/main/resources/icons/action-wizard-previous-16.png jaxx/trunk/jaxx-runtime-swing/src/main/resources/icons/action-wizard-refresh-16.png jaxx/trunk/jaxx-runtime-swing/src/main/resources/icons/action-wizard-start-16.png jaxx/trunk/jaxx-runtime-swing/src/main/resources/icons/action-wizard-state-canceled-16.png jaxx/trunk/jaxx-runtime-swing/src/main/resources/icons/action-wizard-state-failed-16.png jaxx/trunk/jaxx-runtime-swing/src/main/resources/icons/action-wizard-state-need_fix-16.png jaxx/trunk/jaxx-runtime-swing/src/main/resources/icons/action-wizard-state-pending-16.png jaxx/trunk/jaxx-runtime-swing/src/main/resources/icons/action-wizard-state-running-16.png jaxx/trunk/jaxx-runtime-swing/src/main/resources/icons/action-wizard-state-successed-16.png Log: quelques modifications sur le DataContext et le WizardModel Modified: jaxx/trunk/jaxx-runtime-api/src/main/java/jaxx/runtime/DataContext.java =================================================================== --- jaxx/trunk/jaxx-runtime-api/src/main/java/jaxx/runtime/DataContext.java 2009-04-06 10:29:08 UTC (rev 1299) +++ jaxx/trunk/jaxx-runtime-api/src/main/java/jaxx/runtime/DataContext.java 2009-04-08 03:26:10 UTC (rev 1300) @@ -31,7 +31,7 @@ protected DataContextEntry<?>[] entries; protected final String[] DEFAULT_JAXX_PCS; - public abstract String getContextPath(Object e); + public abstract String getContextPath(Object... e); public DataContext(String[] DEFAULT_JAXX_PCS, DataContextEntry<?>[] entries) { this.DEFAULT_JAXX_PCS = DEFAULT_JAXX_PCS; @@ -67,6 +67,22 @@ protected JAXXContext getParentContext() { return null; } + + @Override + public <T> void removeContextValue(Class<T> klazz, String name) { + if (log.isTraceEnabled()) { + log.trace(klazz + " - " + name); + } + super.removeContextValue(klazz, name); + } + + @Override + public <T> void setContextValue(T o, String name) { + if (log.isTraceEnabled()) { + log.trace(name + " - " + o.getClass()); + } + super.setContextValue(o, name); + } }; pcs = new PropertyChangeSupport(this); } @@ -129,41 +145,35 @@ } public <T> T getContextValue(DataContextEntry<T> entry, String key) { - if (key == null) { - throw new NullPointerException("key parameter can not be null!"); - } - String contextKey = entry.hashCode() + "#" + key; + String contextKey = getKey(entry, key); T result = delegate.getContextValue(entry.getKlass(), contextKey); return result; } public void setContextValue(DataContextEntry entry, Object value, String key) { - if (key == null) { - throw new NullPointerException("key parameter can not be null!"); - } - String contextKey = entry.hashCode() + "#" + key; + String contextKey = getKey(entry, key); delegate.setContextValue(value, contextKey); } public void removeContextValue(DataContextEntry entry, Object value, String key) { - if (key == null) { - throw new NullPointerException("key parameter can not be null!"); - } - String contextKey = entry.hashCode() + "#" + key; + String contextKey = getKey(entry, key); delegate.removeContextValue(value.getClass(), contextKey); } @SuppressWarnings("unchecked") public void updateSelectedData(String path, Object data, UpdateDataContext updator) { + if (log.isDebugEnabled()) { + log.debug("----------------------------------------------------------------"); + } if (currentEntry != null) { if (log.isDebugEnabled()) { log.debug("remove from old entry " + currentEntry); } for (DataContextEntry<?> s : currentEntry) { - if (log.isTraceEnabled()) { - log.trace("remove entry " + s); + if (log.isDebugEnabled()) { + log.debug("remove entry " + s); } updator.onRemovingData(this, s); } @@ -179,6 +189,9 @@ for (DataContextEntry<?> s : iterateToLevel(currentEntry.getLevel())) { + if (log.isDebugEnabled()) { + log.debug("add entry " + s); + } updator.onAddingData(this, s, path); } } @@ -233,8 +246,22 @@ pcs.firePropertyChange(name, oldValue, newValue); } + protected String getKey(DataContextEntry entry, String key) { + String result = null; + if (key != null) { + result = entry.hashCode() + "#" + key; + } + return result; + } + public void close() throws Exception { clear(); + + // suppression des ecouteurs + + for (PropertyChangeListener l : getPropertyChangeListeners()) { + removePropertyChangeListener(l); + } } public void clear() { @@ -283,14 +310,6 @@ public abstract String getContextPath(Object... args); - public E getData(JAXXContext c) { - return c.getContextValue(klass, null); - } - - public E getData(JAXXContext c, String context) { - return c.getContextValue(klass, context); - } - public boolean acceptPath(String path) { return getPattern().matcher(path).matches(); } @@ -316,7 +335,7 @@ public static interface UpdateDataContext<D extends DataContext> { - void onRemovingData(D context, DataContextEntry entry); + void onRemovingData(D context, DataContextEntry<?> entry); void onAddingData(D context, DataContextEntry entry, String path); } Modified: jaxx/trunk/jaxx-runtime-swing/src/main/java/jaxx/runtime/swing/wizard/WizardOperationModel.java =================================================================== --- jaxx/trunk/jaxx-runtime-swing/src/main/java/jaxx/runtime/swing/wizard/WizardOperationModel.java 2009-04-06 10:29:08 UTC (rev 1299) +++ jaxx/trunk/jaxx-runtime-swing/src/main/java/jaxx/runtime/swing/wizard/WizardOperationModel.java 2009-04-08 03:26:10 UTC (rev 1300) @@ -21,7 +21,7 @@ public static final String OPERATION_STATE_PROPERTY_NAME = "operationState"; public static final String MODEL_STATE_PROPERTY_NAME = "modelState"; public static final String WAS_STARTED_PROPERTY_NAME = "wasStarted"; - + /** * La liste des opérations à effectuer */ @@ -136,7 +136,7 @@ } public void cancel() { - + for (E op : operations) { if (getOperationState(op) == WizardOperationState.PENDING) { // on annule l'opération à venir @@ -190,6 +190,12 @@ firePropertyChange(MODEL_STATE_PROPERTY_NAME, null, modelState); } + public WizardOperationAction reloadOperation(E operation) { + operationActions.remove(operation); + WizardOperationAction newOp = getOperationAction(operation); + return newOp; + } + protected void setModelState(WizardOperationState modelState) { WizardOperationState oldValue = this.modelState; this.modelState = modelState; Modified: jaxx/trunk/jaxx-runtime-swing/src/main/resources/icons/action-wizard-config-16.png =================================================================== (Binary files differ) Modified: jaxx/trunk/jaxx-runtime-swing/src/main/resources/icons/action-wizard-message-16.png =================================================================== (Binary files differ) Modified: jaxx/trunk/jaxx-runtime-swing/src/main/resources/icons/action-wizard-next-16.png =================================================================== (Binary files differ) Modified: jaxx/trunk/jaxx-runtime-swing/src/main/resources/icons/action-wizard-pause-16.png =================================================================== (Binary files differ) Modified: jaxx/trunk/jaxx-runtime-swing/src/main/resources/icons/action-wizard-previous-16.png =================================================================== (Binary files differ) Modified: jaxx/trunk/jaxx-runtime-swing/src/main/resources/icons/action-wizard-refresh-16.png =================================================================== (Binary files differ) Modified: jaxx/trunk/jaxx-runtime-swing/src/main/resources/icons/action-wizard-start-16.png =================================================================== (Binary files differ) Modified: jaxx/trunk/jaxx-runtime-swing/src/main/resources/icons/action-wizard-state-canceled-16.png =================================================================== (Binary files differ) Modified: jaxx/trunk/jaxx-runtime-swing/src/main/resources/icons/action-wizard-state-failed-16.png =================================================================== (Binary files differ) Modified: jaxx/trunk/jaxx-runtime-swing/src/main/resources/icons/action-wizard-state-need_fix-16.png =================================================================== (Binary files differ) Modified: jaxx/trunk/jaxx-runtime-swing/src/main/resources/icons/action-wizard-state-pending-16.png =================================================================== (Binary files differ) Modified: jaxx/trunk/jaxx-runtime-swing/src/main/resources/icons/action-wizard-state-running-16.png =================================================================== (Binary files differ) Modified: jaxx/trunk/jaxx-runtime-swing/src/main/resources/icons/action-wizard-state-successed-16.png =================================================================== (Binary files differ)
participants (1)
-
tchemit@users.labs.libre-entreprise.org