Sample Viewer Window Attributes Shortcut Panel Implementation

ABSTRACTVIEWERWINDOWATTRIBUTESSHORTCUTEDITOR.JAVA

package com.interactive.intviewer.spectrumanalysis.editor.shortcut;
import com.interactive.intviewerapi.editors.*;
import com.interactive.intviewer.util.StringUtils;
import com.interactive.intviewerapi.windows.AbstractViewerWindow;
import com.interactive.intviewerapi.windows.IViewerWindow;
import javax.swing.Icon;
/**
 * The <code>AbstractViewerWindowAttributesShortcutEditor</code> class is an abstract class which can be extended
 * when creating attributes shortcut editors for viewer windows.
 * <p>
 * This class is part of the INTViewer <code>IntviewerCore</code> module.
 * <p>
 * @see AbstractViewerWindowAttributesShortcutPanel
 */
public abstract class AbstractViewerWindowAttributesShortcutEditor extends AbstractPropertyProviderShortcutEditor {
    /**
     * Constructs a new viewer window attributes shortcut editor for the specified viewer window.
     * @param viewerWindow viewer window being displayed by this editor
     */
    public AbstractViewerWindowAttributesShortcutEditor(IViewerWindow viewerWindow) {
        super(viewerWindow);
    }
    @Override
    public String getDisplayName() {
        return StringUtils.getTruncatedString(((IViewerWindow) propertyProvider).getTitle(), 36);
    }
    @Override
    public Icon getIcon() {
        return ((AbstractViewerWindow) propertyProvider).getFrameIcon();
    }
    /**
     * Returns the viewer window being edited, as specified in the constructor.
     * @return a <code>IViewerWindow</code> object
     */
    protected IViewerWindow getViewerWindow() {
        return (IViewerWindow) propertyProvider;
    }
}

ABSTRACTVIEWERWINDOWATTRIBUTESSHORTCUTPANEL.JAVA

package com.interactive.intviewer.spectrumanalysis.editor.shortcut;
import com.interactive.intviewerapi.editors.*;
import com.interactive.intviewerapi.windows.IViewerWindow;
/**
 * The <code>AbstractViewerWindowAttributesShortcutPanel</code> class is an abstract class which can be extended
 * when creating attributes shortcut panels for viewer windows.
 * <p>
 * This class is part of the INTViewer <code>IntviewerCore</code> module.
 * <p>
 * @see AbstractViewerWindowAttributesShortcutEditor
 */
public abstract class AbstractViewerWindowAttributesShortcutPanel extends AbstractPropertyProviderShortcutPanel {
    /**
     * Constructs a new viewerWindow attributes shortcut panel for the specified viewer window.
     * @param viewerWindow object being displayed by this panel
     */
    public AbstractViewerWindowAttributesShortcutPanel(IViewerWindow viewerWindow) {
        super(viewerWindow);
    }
    /**
     * Returns the viewer window being edited, as specified in the constructor.
     * @return a <code>IViewerWindow</code> object
     */
    protected IViewerWindow getViewerWindow() {
        return (IViewerWindow) propertyProvider;
    }
}