Ignore:
Timestamp:
2012-12-25T23:43:22+01:00 (13 years ago)
Author:
Don-vip
Message:

Allow to access directly to validator preferences from validator dialog with a small preferences button left to pin button.
Generic approach in order to be reused by plugins using dialogs.
This leads to some changes in preferences settings system, but without any break in compatibility.
The only impact is the deprecation of some public JTabbedPane fields, that will be removed mid-2013.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/TabPreferenceSetting.java

    r4989 r5631  
    11// License: GPL. Copyright 2007 by Immanuel Scholz and others
    22package org.openstreetmap.josm.gui.preferences;
     3
     4import java.awt.Component;
    35
    46/**
     
    2931    /**
    3032     * Called during preferences tab initialization to display a description in one sentence for this tab.
    31      * Will be displayedin italic under the title.
     33     * Will be displayed in italic under the title.
    3234     * @return The description of this preferences tab.
    3335     */
    3436    public String getDescription();
     37
     38    /**
     39     * Adds a new sub preference settings tab with the given title and component.
     40     * @param sub The new sub preference settings.
     41     * @param title The tab title.
     42     * @param component The tab component.
     43     * @since 5631
     44     */
     45    public void addSubTab(SubPreferenceSetting sub, String title, Component component);
     46   
     47    /**
     48     * Adds a new sub preference settings tab with the given title, component and tooltip.
     49     * @param sub The new sub preference settings.
     50     * @param title The tab title.
     51     * @param component The tab component.
     52     * @param tip The tab tooltip.
     53     * @since 5631
     54     */
     55    public void addSubTab(SubPreferenceSetting sub, String title, Component component, String tip);
     56
     57    /**
     58     * Registers a sub preference settings to an existing tab component.
     59     * @param sub The new sub preference settings.
     60     * @param component The component for which a tab already exists.
     61     * @since 5631
     62     */
     63    public void registerSubTab(SubPreferenceSetting sub, Component component);
     64   
     65    /**
     66     * Returns the tab component related to the specified sub preference settings
     67     * @param sub The requested sub preference settings.
     68     * @return The component related to the specified sub preference settings, or null.
     69     * @since 5631
     70     */
     71    public Component getSubTab(SubPreferenceSetting sub);
     72
     73    /**
     74     * Selects the specified sub preference settings, if applicable. Not all Tab preference settings need to implement this.
     75     * @param subPref The sub preference settings to be selected.
     76     * @return true if the specified preference settings have been selected, false otherwise.
     77     * @since 5631
     78     */
     79    public boolean selectSubTab(SubPreferenceSetting subPref);
    3580}
Note: See TracChangeset for help on using the changeset viewer.