001// License: GPL. For details, see LICENSE file.
002package org.openstreetmap.josm.gui.dialogs.relation.actions;
003
004import javax.swing.Action;
005
006import org.openstreetmap.josm.gui.dialogs.relation.IRelationEditor;
007import org.openstreetmap.josm.gui.dialogs.relation.MemberTable;
008import org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel;
009import org.openstreetmap.josm.gui.dialogs.relation.SelectionTable;
010import org.openstreetmap.josm.gui.dialogs.relation.SelectionTableModel;
011import org.openstreetmap.josm.gui.tagging.TagEditorModel;
012import org.openstreetmap.josm.gui.tagging.ac.AutoCompletingTextField;
013
014/**
015 * This interface provides access to the relation editor for actions.
016 * <p>
017 *
018 * @author Michael Zangl
019 * @since 14027
020 */
021public interface IRelationEditorActionAccess {
022
023    /**
024     * Adds a keyboard action to the member table.
025     * @param actionMapKey The key to use
026     * @param action The action to map for that key.
027     */
028    default void addMemberTableAction(String actionMapKey, Action action) {
029        getMemberTable().getActionMap().put(actionMapKey, action);
030    }
031
032    /**
033     * Get the member table that is used by the dialog.
034     * @return The member table
035     */
036    MemberTable getMemberTable();
037
038    /**
039     * Get the model the member table is using.
040     * @return That model
041     */
042    MemberTableModel getMemberTableModel();
043
044    /**
045     * Get the table that displays the current user selection
046     * @return That table
047     */
048    SelectionTable getSelectionTable();
049
050    /**
051     * Get the model that the selection table is based on.
052     * @return The model
053     */
054    SelectionTableModel getSelectionTableModel();
055
056    /**
057     * Get the current relation editor
058     * @return The relation editor object.
059     */
060    IRelationEditor getEditor();
061
062    /**
063     * Gets the model for the tag table.
064     * @return The tag editor model.
065     */
066    TagEditorModel getTagModel();
067
068    /**
069     * Get the text field that is used to edit the role.
070     * @return The role text field.
071     */
072    AutoCompletingTextField getTextFieldRole();
073}