Package com.lightcrafts.app

Source Code of com.lightcrafts.app.EditorButton

/* Copyright (C) 2005-2011 Fabio Riccardi */

package com.lightcrafts.app;

import com.lightcrafts.ui.editor.Document;

import javax.swing.*;

/**
* A FrameButton that enables and disables according to whether the frame has
* an open document.
*/
class EditorButton extends FrameButton {

    EditorButton(ComboFrame frame, String text) {
        super(frame, text);
    }

    EditorButton(ComboFrame frame, Icon icon) {
        super(frame, icon);
    }

    void updateButton() {
        final ComboFrame frame = getComboFrame();
        final Document doc = frame.getDocument();
        setEnabled(doc != null);
    }
}
TOP

Related Classes of com.lightcrafts.app.EditorButton

TOP
Copyright © 2018 www.massapi.com. 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.