2 * This file is part of NixNote
\r
3 * Copyright 2009 Randy Baumgarte
\r
5 * This file may be licensed under the terms of of the
\r
6 * GNU General Public License Version 2 (the ``GPL'').
\r
8 * Software distributed under the License is distributed
\r
9 * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
\r
10 * express or implied. See the GPL for the specific language
\r
11 * governing rights and limitations.
\r
13 * You should have received a copy of the GPL along with this
\r
14 * program. If not, go to http://www.gnu.org/licenses/gpl.html
\r
15 * or write to the Free Software Foundation, Inc.,
\r
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
\r
20 package cx.fbn.nevernote.filters;
\r
22 import java.util.List;
\r
24 import com.evernote.edam.type.Note;
\r
25 import com.evernote.edam.type.Tag;
\r
27 import cx.fbn.nevernote.sql.DatabaseConnection;
\r
28 import cx.fbn.nevernote.utilities.ApplicationLogger;
\r
30 public class FilterEditorTags {
\r
31 DatabaseConnection conn;
\r
32 ApplicationLogger logger;
\r
33 public boolean permitNew;
\r
35 public FilterEditorTags(DatabaseConnection conn, ApplicationLogger logger) {
\r
36 this.logger = logger;
\r
41 public List<Tag> getValidTags(Note note) {
\r
42 // Reset permit new flag
\r
45 boolean linked = conn.getNotebookTable().isLinked(note.getNotebookGuid());
\r
47 // If the notebook is linked, then we really only need to return the one notebookd
\r
50 return conn.getTagTable().getTagsForNotebook(note.getNotebookGuid());
\r
52 return conn.getTagTable().getTagsForNotebook("");
\r