Package pdfdb.settings

Examples of pdfdb.settings.ColumnSettingsManager


     *  columns are altered to ensure against duplications.
     * @param newIndex index to move to.
     * @param oldIndex index to move from */
    public synchronized void changeOrder(int newIndex, int oldIndex)
    {
        ColumnSettingsManager manager = ColumnSettingsManager.getInstance();
        ColumnState target = states.get(oldIndex);
        states.remove(oldIndex);
        states.add(newIndex, target);
        for (int i = 0; i < states.size(); i++)
        {
            ColumnState tmp = states.get(i);
            ColumnState required = manager.get(tmp.getKey());
            if (!required.getKey().equals(target.getKey()))
            {
                required.setIndex(i);
                tmp.setIndex(i);
            }
View Full Code Here


    /** Ensures the specified column has the last index in the collection.
     * @param key The key identfying the column. */
    public synchronized void ensureLast(String key)
    {
        ColumnSettingsManager manager = ColumnSettingsManager.getInstance();
        ColumnState state = manager.get(key);
        if (visibleStates.contains(state))
            state.setIndex(columnCount - 1);
        else state.setIndex(columnCount);
    }
View Full Code Here

     * Additional state held by this ColumnData instance is not considered.
     * @param key The key of the column.
     * @return The requested width of the column. */
    public synchronized int getWidth(String key)
    {
        ColumnSettingsManager manager = ColumnSettingsManager.getInstance();
        return manager.get(key).getWidth();
    }
View Full Code Here

     *  Additional state held by this ColumnData instance is not considered.
     * @param key The key of the column.
     * @return The requested index of the column. */
    public synchronized int getIndex(String key)
    {
        ColumnSettingsManager manager = ColumnSettingsManager.getInstance();
        return manager.get(key).getIndex();
    }
View Full Code Here

     *  not considered.
     * @param key The key to check.
     * @return Whether the column is visible. */
    public synchronized boolean isVisible(String key)
    {
        ColumnSettingsManager manager = ColumnSettingsManager.getInstance();
        return manager.get(key).isVisible();
    }
View Full Code Here

     * @param visibleOnly Whether the column exists in the visible items
     * or only in the collection of all columns.
     * @return Position or -1. */
    public synchronized int indexOf(String key, boolean visibleOnly)
    {
        ColumnSettingsManager manager = ColumnSettingsManager.getInstance();
        if (visibleOnly)
        {
            return visibleStates.indexOf(manager.get(key));
        }
        else
        {
            return states.indexOf(manager.get(key));
        }
    }
View Full Code Here

    /** Saves state of the ColumnData to the underlying manager.
     * @throws java.io.IOException If the save fails. */
    public synchronized void save() throws IOException
    {
        ColumnSettingsManager manager = ColumnSettingsManager.getInstance();
        manager.save();
    }
View Full Code Here

     * settings manager's cache is cleared and re-reads the settings file
     * during this method.
     * @return A list of column states. */
    private List<ColumnState> getStates()
    {
        ColumnSettingsManager manager = ColumnSettingsManager.getInstance();
        List<ColumnState> stateList = new Vector<ColumnState>();
        for (String key : manager.keySet())
        {
            ColumnState state = manager.get(key);
            stateList.add(state);
        }
        Collections.sort(stateList);
        return stateList;
    }
View Full Code Here

     * new visibility will be equal to the visible argument.
     * @param key The key to alter.
     * @param visible The new visibility. */
    public synchronized void setVisibility(String key, boolean visible)
    {
        ColumnSettingsManager manager = ColumnSettingsManager.getInstance();
        ColumnState state = manager.get(key);
        state.setIsVisible(visible);
    }
View Full Code Here

    /** Sets the requested width of the specified column.
     * @param key The key that defines the column to be altered.
     * @param width The new width. */
    public synchronized void setWidth(String key, int width)
    {
        ColumnSettingsManager manager = ColumnSettingsManager.getInstance();
        ColumnState state = manager.get(key);
        state.setWidth(width);
    }
View Full Code Here

TOP

Related Classes of pdfdb.settings.ColumnSettingsManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.