
com.github.andy2003.logging.OpenLogFileAction Maven / Gradle / Ivy
The newest version!
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.github.andy2003.logging;
import com.github.andy2003.core.LogFile;
import com.github.andy2003.logging.input.LogInputTopComponent;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
import org.openide.awt.ActionReferences;
import org.openide.awt.ActionRegistration;
/**
*
* @author Jan-Niklas Meier
*/
@ActionRegistration(displayName = "Open Log file...", iconBase = "org/tango-project/tango-icon-theme/16x16/actions/document-open.png", iconInMenu = true, surviveFocusChange = true)
@ActionID(category = "Log files", id = "com.github.andy2003.logging.OpenLogFileAction")
@ActionReferences(value = {
@ActionReference(path = "Menu/Log files", position = 10)})
public class OpenLogFileAction extends AbstractAction {
private LogFile logFile;
public OpenLogFileAction(LogFile context) {
putValue(NAME, "Open");
logFile = context;
}
@Override
public void actionPerformed(ActionEvent e) {
LogInputTopComponent tc = new LogInputTopComponent();
tc.setLogFile(logFile);
tc.open();
tc.requestActive();
}
};
© 2015 - 2025 Weber Informatics LLC | Privacy Policy