Ignore:
Timestamp:
07/10/13 22:41:02 (11 years ago)
Author:
psniegowski
Message:

HIGHLIGTS:

  • complete events implementation
  • add CLI in Java Framsticks server
  • add automatic registration for events in GUI
  • improve objects fetching (object are never overwritten with new instances)
  • properly react for ListChange? events
  • add ListPanel? with table view
    • columns to be shown may be statically specified in configuration
    • currently modyfying data through tables is not available
  • improve maven configuration
    • configuration file may be specified without touching pom.xml

CHANGELOG:
Extract constants from Flags into ParamFlags? and SetStateFlags?.

Extract flags I/O to FlagsUtils? class.

Configured maven to exec given resource configuration.

For example:
mvn exec:exec -Dframsticks.config=/configs/managed-console.xml

Cleanup pom.xml

Rename ObjectTree? to LocalTree? (also make LocalTree? and RemoteTree? final).

Minor change.

Add maximum number of columns in ListPanelProvider?.

Improve ColumnsConfig? interpretation.

Automatically fill FramsClass?.name if trying to construct empty.

Improve identitifer case mangling in XmlLoader?.

Introduce configurable ColumnsConfig?.

Draft working version of ListPanel?.

Table is being shown (although empty).

More improvements to table building.

Move some functionality from Frame to TreeModel?.

Move tree classes in gui to separate package.

Remove old table related classes.

Add draft implementation of TableModel?.

Redirect ParamBuilder?.forAccess to AccessInterface?.

Optimize ParamBuilder?.forAccess()

Do not clear list when loading.

Do not load fetched values directly.

Implement different AccessInterface? copying policy.

Optimize fetching values routine.

Remove Mode enum (work out get semantics).

Some improvements to ListChange? handling.

Improve UniqueListAccess?.

Add reaction for ListChanges? in the TreeNode?.

EventListeners? are being added in the TreeNode?.

Listeners for ListParams? are now very naive (they download
whole list).

Automatially register on events in GUI.

Events are working in RemoteTree? and Server.

Move listeners to the ClientSideManagedConnection?.

Remove old classes responsible for event subscriptions.

Improve event reading.

Improve events handling at server side.

Add register attribute in FramsClassAnnotation?
to automatically also register other classes.

Registering events works.

Setup for remote listeners registration.

More improvements.

Minor changes.

Add rootTree to the ClientAtServer?.

Moving CLI to the ClientAtServer?.

Fix bug: use Void.TYPE instead of Void.class

More development around CLI.

  • Improve Path resolving.

Add synthetic root to ObjectTree?.

It is needed to allow sybling for the original root
that would containg CLI.

Some work with registering events in RemoteTree?.

Draft implementation of listener registering in RemoteTree?.

Support events registration in the ObjectTree?.

Add events support to ReflectionAccess?.

EventParam? is recognized by ParamCandidate?.

Prepare interface for Events across project.

Add EventListener? and API for listeners in Tree.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • java/main/src/main/java/com/framsticks/params/ParamCandidate.java

    r90 r99  
    7373        protected final OneTime<Method> getter = new OneTime<>("getter");
    7474        protected final OneTime<Method> caller = new OneTime<>("caller");
     75        protected final OneTime<Method> adder = new OneTime<>("adder");
     76        protected final OneTime<Method> remover = new OneTime<>("remover");
    7577
    7678        protected final List<ParamAnnotation> annotations = new LinkedList<>();
     
    142144
    143145        /**
     146         * @return the getter
     147         */
     148        public Method getAdder() {
     149                return adder.get();
     150        }
     151
     152        /**
     153         * @return the getter
     154         */
     155        public Method getRemover() {
     156                return remover.get();
     157        }
     158
     159        /**
    144160         * @return the annotations
    145161         */
     
    150166        void validate() throws ConstructionException {
    151167                try {
     168                        if (adder.has() != remover.has()) {
     169                                throw new ConstructionException().msg("only one of event manipulator methods is defined");
     170                        }
     171                        if (adder.has() && remover.has()) {
     172                                return;
     173                        }
    152174                        if (caller.has()) {
    153175                                if (!isPublic(caller)) {
     
    174196                                throw new ConstructionException().msg("missing getter or field");
    175197                        }
     198                        if (getter.has() || field.has() || setter.has()) {
     199                                if (type.get().equals(Void.TYPE)) {
     200                                        throw new ConstructionException().msg("type of field is void");
     201                                }
     202                        }
    176203                } catch (ConstructionException e) {
    177204                        throw e.arg("in", this);
     
    183210                        return false;
    184211                }
     212                if (adder.has() || remover.has()) {
     213                        return false;
     214                }
    185215                if (Collection.class.isAssignableFrom(getRawType())) {
    186216                        return false;
     
    197227        boolean isReadOnly() {
    198228                if (caller.has()) {
     229                        return false;
     230                }
     231                if (adder.has() || remover.has()) {
    199232                        return false;
    200233                }
     
    229262                        }
    230263                        Type[] ps = m.getGenericParameterTypes();
     264                        Class<?>[] pts = m.getParameterTypes();
    231265                        if (ps.length == 0) {
     266                                if (m.getReturnType().equals(Void.TYPE)) {
     267                                        throw new ConstructionException().msg("failed to add getter of void return type");
     268                                }
    232269                                getter.set(m);
    233270                                setType(m.getGenericReturnType());
     
    235272                        }
    236273                        if (ps.length == 1) {
     274                                if (pts[0].equals(EventListener.class)) {
     275                                        if (member.getName().startsWith("add")) {
     276                                                adder.set(m);
     277                                                setType(ps[0]);
     278                                                return;
     279                                        }
     280                                        if (member.getName().startsWith("remove")) {
     281                                                remover.set(m);
     282                                                setType(ps[0]);
     283                                                return;
     284                                        }
     285                                        throw new ConstructionException().msg("invalid name of event manipulator").arg("method", m).arg("in", this);
     286                                }
    237287                                setter.set(m);
    238288                                setType(ps[0]);
     
    251301                int f = 0;
    252302                if (isReadOnly()) {
    253                         f |= Flags.READONLY;
     303                        f |= ParamFlags.READONLY;
    254304                }
    255305                return f;
Note: See TracChangeset for help on using the changeset viewer.