001 /*
002 * This file is part of muCommander, http://www.mucommander.com
003 * Copyright (C) 2002-2008 Maxence Bernard
004 *
005 * muCommander is free software; you can redistribute it and/or modify
006 * it under the terms of the GNU General Public License as published by
007 * the Free Software Foundation; either version 3 of the License, or
008 * (at your option) any later version.
009 *
010 * muCommander is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
013 * GNU General Public License for more details.
014 *
015 * You should have received a copy of the GNU General Public License
016 * along with this program. If not, see <http://www.gnu.org/licenses/>.
017 */
018
019 package com.mucommander.command;
020
021 /**
022 * Receive notification of the logical structure of a custom association list.
023 * @author Nicolas Rinaudo
024 */
025 public interface AssociationBuilder {
026 /**
027 * Notifies the builder that association building is about to start.
028 * @throws CommandException if an error occurs.
029 */
030 public void startBuilding() throws CommandException;
031
032 /**
033 * Notifies the builder that association building is finished.
034 * @throws CommandException if an error occurs.
035 */
036 public void endBuilding() throws CommandException;
037
038 /**
039 * Notifies the builder that a new association declaration is starting.
040 * @param command command to call when the association is matched.
041 * @throws CommandException if an error occurs.
042 */
043 public void startAssociation(String command) throws CommandException;
044
045 /**
046 * Notifies the builder that the current association declaration is finished.
047 * @throws CommandException if an error ocurs.
048 */
049 public void endAssociation() throws CommandException;
050
051 /**
052 * Adds a mask to the current association.
053 * @param mask regular expression that a file name must match in order to match the association.
054 * @param isCaseSensitive whether the regular expression is case sensitive.
055 * @throws CommandException if an error occurs.
056 */
057 public void setMask(String mask, boolean isCaseSensitive) throws CommandException;
058
059 /**
060 * Adds a <i>symlink</i> filter on the current association.
061 * @param isSymlink whether symbolic links must be refused or accepted by the association.
062 * @throws CommandException if an error occurs.
063 */
064 public void setIsSymlink(boolean isSymlink) throws CommandException;
065
066 /**
067 * Adds a <i>hidden</i> filter on the current association.
068 * @param isHidden whether hidden files must be refused or accepted by the association.
069 * @throws CommandException if an error occurs.
070 */
071 public void setIsHidden(boolean isHidden) throws CommandException;
072
073 /**
074 * Adds a <i>readable</i> filter on the current association.
075 * @param isReadable whether readable files must be refused or accepted by the association.
076 * @throws CommandException if an error occurs.
077 */
078 public void setIsReadable(boolean isReadable) throws CommandException;
079
080 /**
081 * Adds a <i>writable</i> filter on the current association.
082 * @param isWritable whether writable files must be refused or accepted by the association.
083 * @throws CommandException if an error occurs.
084 */
085 public void setIsWritable(boolean isWritable) throws CommandException;
086
087 /**
088 * Adds a <i>executable</i> filter on the current association.
089 * @param isExecutable whether executable files must be refused or accepted by the association.
090 * @throws CommandException if an error occurs.
091 */
092 public void setIsExecutable(boolean isExecutable) throws CommandException;
093 }