Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B474E200B8B for ; Tue, 4 Oct 2016 22:09:38 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id B2F88160ACC; Tue, 4 Oct 2016 20:09:38 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D043A160AC7 for ; Tue, 4 Oct 2016 22:09:37 +0200 (CEST) Received: (qmail 56354 invoked by uid 500); 4 Oct 2016 20:09:36 -0000 Mailing-List: contact odf-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: odf-dev@incubator.apache.org Delivered-To: mailing list odf-commits@incubator.apache.org Received: (qmail 56345 invoked by uid 99); 4 Oct 2016 20:09:36 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Oct 2016 20:09:36 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 85FFF18059B for ; Tue, 4 Oct 2016 20:09:36 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.999 X-Spam-Level: X-Spam-Status: No, score=-1.999 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id VNwPqeBv-o1q for ; Tue, 4 Oct 2016 20:09:35 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id EAB205F36A for ; Tue, 4 Oct 2016 20:09:34 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id CDCCCE017A for ; Tue, 4 Oct 2016 20:09:33 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 846043A0248 for ; Tue, 4 Oct 2016 20:09:33 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r1763322 - /incubator/odf/trunk/simple/src/main/java/org/odftoolkit/simple/common/navigation/Selection.java Date: Tue, 04 Oct 2016 20:09:32 -0000 To: odf-commits@incubator.apache.org From: svanteschubert@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20161004200933.846043A0248@svn01-us-west.apache.org> archived-at: Tue, 04 Oct 2016 20:09:38 -0000 Author: svanteschubert Date: Tue Oct 4 20:09:32 2016 New Revision: 1763322 URL: http://svn.apache.org/viewvc?rev=1763322&view=rev Log: #ODFTOOLKIT-300# Allow removal of Selections for Navigation by surfx and Daniel Fernández Modified: incubator/odf/trunk/simple/src/main/java/org/odftoolkit/simple/common/navigation/Selection.java Modified: incubator/odf/trunk/simple/src/main/java/org/odftoolkit/simple/common/navigation/Selection.java URL: http://svn.apache.org/viewvc/incubator/odf/trunk/simple/src/main/java/org/odftoolkit/simple/common/navigation/Selection.java?rev=1763322&r1=1763321&r2=1763322&view=diff ============================================================================== --- incubator/odf/trunk/simple/src/main/java/org/odftoolkit/simple/common/navigation/Selection.java (original) +++ incubator/odf/trunk/simple/src/main/java/org/odftoolkit/simple/common/navigation/Selection.java Tue Oct 4 20:09:32 2016 @@ -1,4 +1,4 @@ -/* +/* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information @@ -21,7 +21,6 @@ package org.odftoolkit.simple.common.nav import java.util.Hashtable; import java.util.Vector; - import org.odftoolkit.odfdom.pkg.OdfElement; /** @@ -40,7 +39,7 @@ public abstract class Selection { /** * Get the container element of this Selection. - * + * * @return the container element */ public OdfElement getElement() { @@ -51,7 +50,7 @@ public abstract class Selection { * Get the start index of the text content in the container element. This is * only meaningful for {@link TextSelection TextSelection} and its sub * classes, other type of Selection will return 0. - * + * * @return the start index of the container element */ public int getIndex() { @@ -60,7 +59,7 @@ public abstract class Selection { /** * Cut current Selection. - * + * * @throws InvalidNavigationException */ public abstract void cut() throws InvalidNavigationException; @@ -68,7 +67,7 @@ public abstract class Selection { /** * Paste current Selection at front of the specified position * Selection. - * + * * @param positionItem * the position Selection * @throws InvalidNavigationException @@ -78,7 +77,7 @@ public abstract class Selection { /** * Paste current Selection at end of the specified position * Selection. - * + * * @param positionItem * the position Selection * @throws InvalidNavigationException @@ -89,7 +88,7 @@ public abstract class Selection { * When a selected item has been deleted, the Selections after * this deleted Selection should be refreshed, as these * Selections index have been changed. - * + * * @param deletedItem * the deleted Selection */ @@ -99,7 +98,7 @@ public abstract class Selection { * When a selected item has been inserted, the Selection after * the inserted item should be refresh, as these Selections * index have been changed. - * + * * @param insertedItem * the inserted Selection */ @@ -107,7 +106,7 @@ public abstract class Selection { /** * A quick method to update the index of this Selection. - * + * * @param offset * the offset that the index should be added. */ @@ -125,7 +124,7 @@ public abstract class Selection { /** * Register the Selection item. - * + * * @param item * the Selection item */ @@ -154,7 +153,7 @@ public abstract class Selection { /** * Refresh the Selections in repository after a item is * cut. - * + * * @param cutItem * the cut item */ @@ -174,7 +173,7 @@ public abstract class Selection { /** * Refresh the selections in repository after pastedAtFrontOf operation * is called. - * + * * @param item * the pasted item * @param positionItem @@ -196,7 +195,7 @@ public abstract class Selection { /** * Refresh the Selections in repository after pastedAtEndOf * operation is called. - * + * * @param item * the pasted item * @param positionItem @@ -222,7 +221,7 @@ public abstract class Selection { /** * Remove the Selection from repository. - * + * * @param item * Selection item */ @@ -237,7 +236,7 @@ public abstract class Selection { /** * A direct method to update all the Selections contained * in a element after a certain position. - * + * * @param containerElement * the container element * @param offset @@ -256,6 +255,14 @@ public abstract class Selection { } } + /** + * Clears the repository being used by the SelectionManager. + * Must be called at the end of Navigation. + */ + public static void clearRepository (){ + repository.clear(); + } + private SelectionManager() { } }