ok, it was a very old Code Version.
Better:
package com.mucommander.ui.action.impl;
import com.mucommander.ui.action.AbstractActionDescriptor;
import com.mucommander.ui.action.ActionCategories;
import com.mucommander.ui.action.ActionCategory;
import com.mucommander.ui.action.ActionFactory;
import com.mucommander.ui.action.MuAction;
import com.mucommander.ui.main.MainFrame;
import com.mucommander.file.util.FileSet;
import java.awt.event.KeyEvent;
import java.util.Hashtable;
import javax.swing.KeyStroke;
public class CompareFileAction extends MuAction {
private static final long serialVersionUID = 1L;
public CompareFileAction(MainFrame mainFrame, Hashtable properties) {
super(mainFrame, properties);
}
public void performAction() {
FileSet files1 = mainFrame.getLeftPanel().getFileTable().getSelectedFiles();
FileSet files2 = mainFrame.getRightPanel().getFileTable().getSelectedFiles();
if( (files1.size() == 1) &&
(files2.size() == 1) &&
(files1.fileAt(0).isDirectory() == false) &&
(files2.fileAt(0).isDirectory() == false)) {
String[] tokens = new String[3];
tokens[0] = "opendiff";
tokens[1] = files1.fileAt(0).getAbsolutePath();
tokens[2] = files2.fileAt(0).getAbsolutePath();
try {
ProcessBuilder pb = new ProcessBuilder(tokens);
pb.redirectErrorStream(true);
pb.start();
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
public static class Factory implements ActionFactory {
public MuAction createAction(MainFrame mainFrame, Hashtable properties) {
return new CompareFileAction(mainFrame, properties);
}
}
public static class Descriptor extends AbstractActionDescriptor {
public static final String ACTION_ID = "CompareFile";
public String getId() { return ACTION_ID; }
public ActionCategory getCategory() { return ActionCategories.VIEW; }
public KeyStroke getDefaultAltKeyStroke() { return null; }
public KeyStroke getDefaultKeyStroke() {
return KeyStroke.getKeyStroke(KeyEvent.VK_F7, KeyEvent.ALT_DOWN_MASK);
}
}
}
and in ActionManager.java add:
registerAction(new CompareFileAction.Descriptor(), new CompareFileAction.Factory());
im so sorry about my old stuff
Ronny