// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3)
// Source File Name: FileRightKeyActionGroup.java
package fileexplorer.action;
import fileexplorer.Activator;
import fileexplorer.views.ViewForFileContent;
import java.io.File;
import java.io.IOException;
import java.util.LinkedList;
import java.util.List;
import org.eclipse.jface.action.*;
import org.eclipse.jface.dialogs.*;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.ui.actions.ActionGroup;
public class FileRightKeyActionGroup extends ActionGroup
{
private class NewFolderAction extends Action
{
public void run()
{
String fordname = "";
path = ViewForFileContent.currentpath;
InputDialog input = new InputDialog(null, "\u65B0\u5EFA\u6587\u4EF6\u5939", "\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u5B57", "", new validapter());
if(input.open() == 0)
{
fordname = input.getValue();
if(fordname != null && fordname != "")
{
File file1 = new File((new StringBuilder(String.valueOf(path))).append("\\").append(fordname).toString());
if(!file1.isDirectory())
{
file1.mkdirs();
File file = new File((new StringBuilder(String.valueOf(path))).append("\\").toString());
List list = new LinkedList();
File files[] = file.listFiles();
if(files.length != 0)
{
for(int i = 0; i < files.length; i++)
list.add(files[i]);
}
for(int s = 0; s < files.length; s++)
if(files[s].isDirectory())
ViewForFileContent.FolderNumbers++;
else
ViewForFileContent.FileNumbers++;
tv.setInput(list);
tv.getTable().layout();
} else
{
MessageDialog.openInformation(null, " \u8B66\u544A", "\u6587\u4EF6\u5939\u5DF2\u7ECF\u5B58\u5728\uFF0C\u8BF7\u66F4\u6539\u540D\u5B57");
}
}
}
}
final FileRightKeyActionGroup this$0;
public NewFolderAction()
{
this$0 = FileRightKeyActionGroup.this;
super();
setImageDescriptor(Activator.getImageDescriptor("/icons/fldr_obj.gif"));
setText(" \u6587\u4EF6\u5939");
}
}
private class CopyAction extends Action
{
public void run()
{
File file = (File)tv.getTable().getSelection()[0].getData();
setsrcfile(file);
}
final FileRightKeyActionGroup this$0;
public CopyAction()
{
this$0 = FileRightKeyActionGroup.this;
super();
setText(" \u590D\u5236");
}
}
private class PlasteAction extends Action
{
public void run()
{
}
final FileRightKeyActionGroup this$0;
public PlasteAction()
{
this$0 = FileRightKeyActionGroup.this;
super();
setText(" \u7C98\u8D34");
}
}
private class attributeAction extends Action
{
public void run()
{
tv.refresh();
}
final FileRightKeyActionGroup this$0;
public attributeAction()
{
this$0 = FileRightKeyActionGroup.this;
super();
setText(" \u5C5E\u6027");
setEnabled(false);
}
}
private class deleteAction extends Action
{
public void run()
{
File file = (File)tv.getTable().getSelection()[0].getData();
if(file == null)
{
setEnabled(false);
MessageDialog.openWarning(null, "\u63D0\u9192", "\u672A\u9009\u4E2D\u6587\u4EF6");
} else
{
boolean b = MessageDialog.openQuestion(null, "\u786E\u8BA4\u5220\u9664", "\u786E\u5B9A\u5220\u9664\u5417?");
if(b)
if(file.isFile())
file.delete();
else
if(file.isDirectory())
DeleteDir(file.toString());
path = ViewForFileContent.currentpath;
File file1 = new File((new StringBuilder(String.valueOf(path))).append("\\").toString());
List list = new LinkedList();
File files[] = file1.listFiles();
if(files.length != 0)
{
for(int i = 0; i < files.length; i++)
list.add(files[i]);
}
tv.setInput(list);
tv.getTable().layout();
}
}
final FileRightKeyActionGroup this$0;
public deleteAction()
{
this$0 = FileRightKeyActionGroup.this;
super();
setText(" \u5220\u9664");
}
}
public class validapter
implements IInputValidator
{
public String isValid(String newText)
{
String t = newText.toString();
if(t == "")
return "\u540D\u5B57\u4E0D\u80FD\u4E3A\u7A7A";
else
return null;
}
final FileRightKeyActionGroup this$0;
public validapter()
{
this$0 = FileRightKeyActionGroup.this;
super();
}
}
private class open extends Action
{
public void run()
{
File file = (File)tv.getTable().getSelection()[0].getData();
if(file.isDirectory())
{
String path = file.toString();
File file1 = new File((new StringBuilder(String.valueOf(path))).append("\\").toString());
ViewForFileContent.currentpath = path;
List list = new LinkedList();
File files[] = file1.listFiles();
if(files.length != 0)
{
for(int i = 0; i < files.length; i++)
list.add(files[i]);
}
tv.setInput(list);
tv.getTable().layout();
} else
if(file.isFile())
{
Runtime hello = Runtime.getRuntime();
try
{
hello.exec((new StringBuilder("cmd /E:ON /c start ")).append(file.toString().replace(" ", "\" \"")).toString());
}
catch(IOException e1)
{
e1.printStackTrace();
}
}
}
final FileRightKeyActionGroup this$0;
public open()
{
this$0 = FileRightKeyActionGroup.this;
super();
setText(" \u6253\u5F00");
}
}
private class newwordfile extends Action
{
public void run()
{
CreateFile(".doc");
}
final FileRightKeyActionGroup this$0;
public newwordfile()
{
this$0 = FileRightKeyActionGroup.this;
super();
setImageDescriptor(Activator.getImageDescriptor("/icons/file_obj(1).gif"));
setText(" Microsoft Word \u6587\u