Task #2687

RCP: X.X, simplify TXMResult persistable variables

Added by Matthieu Decorde 8 months ago. Updated 7 months ago.

Status:Closed Start date:12/03/2019
Priority:Normal Due date:
Assignee:- % Done:

100%

Category:Toolbox Spent time: -
Target version:TXM 0.8.1

Description

1) make userPersistable a parameter (see example below)

2a) replace

class TXMResult:
    /**
     * Internal persistable state.
     */
    protected boolean internalPersistable;

    /**
     * User persistable state.
     */
    protected boolean userPersistable;

With:

class TXMResult:
    /**
     * persistable state.
     */
@Parameter(key = TXMPreferences.PERSISTABLE, type = Parameter.INTERNAL)
    protected boolean persistable;
/** re-implement this methods if your result must always is persistable **/
public boolean isInternalPersistable() { return false; }

...

class Partition:
public boolean isInternalPersistable() { return true; }


and find a way to a TXMResult command to tell when it was set persistable at creation time

2b) Current state

Sets the member to true in the constructor of class that needs to be always persisted, eg.:

    /**
     * 
     * @param partition
     */
    public Part(Partition partition, String partName, String query) {
        super(partition);

        this.userName = partName;
        this.pQuery = new CQLQuery(query);
        this.pID = CqpObject.partNamePrefix + CQPCorpus.getNextSubcorpusCounter();
        this.setVisible(false);
        this.internalPersistable = true;
    }

History

#1 Updated by Matthieu Decorde 8 months ago

  • Description updated (diff)

#2 Updated by Sebastien Jacquot 8 months ago

  • Description updated (diff)

#3 Updated by Sebastien Jacquot 7 months ago

  • Status changed from New to Closed
  • Target version changed from TXM 0.8.2 to TXM 0.8.1
  • % Done changed from 0 to 100

Also available in: Atom PDF