⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 searchview.java

📁 基于Eclipse RCP模型下的文档管理程序源代码
💻 JAVA
字号:
// 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:   SearchView.java

package fileexplorer.views;

import java.io.File;
import java.io.PrintStream;
import java.util.*;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.*;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IViewSite;
import org.eclipse.ui.part.ViewPart;

public class SearchView extends ViewPart
{

    public SearchView()
    {
    }

    public void createPartControl(Composite parent)
    {
        final Composite container = new Composite(parent, 0);
        container.setBackground(container.getDisplay().getSystemColor(13));
        GridLayout grid1 = new GridLayout(1, false);
        grid1.marginTop = 8;
        grid1.marginLeft = 2;
        grid1.marginRight = 2;
        container.setLayout(grid1);
        final Group group = new Group(container, 0);
        group.setBackground(container.getDisplay().getSystemColor(13));
        group.setBounds(0, 0, 250, 346);
        group.setText("\u641C\u7D22\u6807\u51C6");
        group.setLayoutData(new GridData(1808));
        group.setLayout(new GridLayout(1, false));
        Label label = new Label(group, 0);
        label.setText("\u5168\u90E8\u6216\u90E8\u5206\u6587\u4EF6\u540D:");
        label.setBounds(23, 49, 125, 22);
        label.setLayoutData(new GridData(768));
        label.setBackground(container.getDisplay().getSystemColor(13));
        text_3 = new Text(group, 2048);
        text_3.setBounds(22, 77, 201, 20);
        text_3.setLayoutData(new GridData(768));
        Label label_1 = new Label(group, 0);
        label_1.setText("\u6307\u5B9A\u6587\u4EF6\u7C7B\u578B:");
        label_1.setBounds(22, 115, 138, 19);
        label_1.setBackground(container.getDisplay().getSystemColor(13));
        combo = new Combo(group, 0);
        combo.setBounds(22, 140, 201, 20);
        combo.setLayoutData(new GridData(768));
        setseatchtype();
        Label label_2 = new Label(group, 0);
        label_2.setText("\u5728\u8FD9\u91CC\u5BFB\u627E:");
        label_2.setBounds(22, 190, 138, 15);
        label_2.setBackground(container.getDisplay().getSystemColor(13));
        combo_1 = new Combo(group, 0);
        combo_1.setBounds(22, 206, 201, 20);
        combo_1.setLayoutData(new GridData(768));
        setseatchpath();
        final Button button = new Button(group, 512);
        button.setText("\u641C\u7D22");
        button.setBounds(24, 408, 76, 22);
        GridData griddata = new GridData(16384, 1024, false, false);
        griddata.widthHint = 70;
        griddata.heightHint = 23;
        button.setLayoutData(griddata);
        progress = new ProgressBar(group, 0x10000);
        progress.setLayoutData(new GridData(768));
        progress.setMaximum(1000);
        progress.setMinimum(0);
        progress.setVisible(false);
        label_3 = new Label(group, 0);
        label_3.setVisible(false);
        label_3.setBackground(container.getDisplay().getSystemColor(13));
        label_3.setLayoutData(new GridData(768));
        button.addSelectionListener(new SelectionAdapter() {

            public void widgetSelected(SelectionEvent e)
            {
                label_3.setVisible(true);
                (new Thread() {

                    public void run()
                    {
                        for(int i = 1; i < 101; i++)
                        {
                            try
                            {
                                Thread.sleep(200L);
                            }
                            catch(Throwable throwable) { }
                            final Integer i_copy = new Integer(i);
                            class _cls1
                                implements Runnable
                            {

                                public void run()
                                {
                                    progress.setSelection(i_copy.intValue() * 10);
                                    if(progress.getSelection() == 1000)
                                    {
                                        button.setEnabled(true);
                                        group.layout();
                                        progress.setVisible(false);
                                        label_3.setText("\u5B8C\u6210\uFF0C\u627E\u5230 12\u4E2A\u6587\u4EF6\uFF0C34\u4E2A\u6587\u4EF6\u5939");
                                        label_3.update();
                                    } else
                                    {
                                        progress.setVisible(true);
                                        label_3.setText("\u6B63\u5728\u641C\u7D22\uFF0C\u8BF7\u7A0D\u540E\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002");
                                        label_3.update();
                                        button.setEnabled(false);
                                        group.layout();
                                    }
                                }

                                final _cls1 this$2;
                                private final Integer val$i_copy;
                                private final Button val$button;
                                private final Group val$group;

                                _cls1()
                                {
                                    this$2 = _cls1.this;
                                    i_copy = integer;
                                    button = button1;
                                    group = group1;
                                    super();
                                }
                            }

                            container.getDisplay().asyncExec(new _cls1());
                        }

                    }

                    final _cls1 this$1;
                    private final Composite val$container;
                    private final Button val$button;
                    private final Group val$group;


                    
                    {
                        this$1 = _cls1.this;
                        container = composite;
                        button = button1;
                        group = group1;
                        super();
                    }
                }
).start();
                group.layout();
            }

            final SearchView this$0;
            private final Group val$group;
            private final Composite val$container;
            private final Button val$button;


            
            {
                this$0 = SearchView.this;
                group = group1;
                container = composite;
                button = button1;
                super();
            }
        }
);
        createActions();
        initializeToolBar();
        initializeMenu();
    }

    private void createActions()
    {
    }

    private void initializeToolBar()
    {
        org.eclipse.jface.action.IToolBarManager toolbarManager = getViewSite().getActionBars().getToolBarManager();
    }

    private void initializeMenu()
    {
        org.eclipse.jface.action.IMenuManager menuManager = getViewSite().getActionBars().getMenuManager();
    }

    public void setFocus()
    {
    }

    public String getsearchname()
    {
        return text_3.getText().toString();
    }

    public String getsearchtype()
    {
        return combo.getSelection().toString();
    }

    public String getsearchpath()
    {
        return combo_1.getSelection().toString();
    }

    public void setseatchtype()
    {
        combo.add("Word\u6587\u4EF6(.doc)", 0);
        combo.add("PowerPoint\u6587\u4EF6(.ppt)", 1);
        combo.add("Excel\u6587\u4EF6(.xlc)", 2);
        combo.add("RM\u6587\u4EF6(.rm)", 3);
        combo.add("Mp3\u6587\u4EF6(.mp3)", 4);
    }

    public void setseatchpath()
    {
        combo_1.add("\u6211\u7684\u7535\u8111", 0);
        File fileRoots[] = File.listRoots();
        int m = fileRoots.length;
        for(int j = 0; j < m; j++)
            if(fileRoots[j].toString().substring(0, 1) == "A" || fileRoots[j].toString().substring(0, 1) == "B")
                combo_1.add((new StringBuilder("3.5 \u8F6F\u76D8(")).append(fileRoots[j].toString().substring(0, 2)).append(")").toString(), j + 1);
            else
                combo_1.add((new StringBuilder("\u672C\u5730\u78C1\u76D8(")).append(fileRoots[j].toString().substring(0, 2)).append(")").toString(), j + 1);

    }

    public void getpathlist(File file, List list)
    {
        int i = 0;
        File files[] = file.listFiles();
        if(file.isDirectory() && file != null)
        {
            while(i < files.length) 
                list.add(files[i]);
            i++;
        }
    }

    public void init()
    {
        list = new LinkedList();
        file = new File("e:\\");
        getpathlist(file, list);
        for(it = list.iterator(); it.hasNext(); System.out.print((new StringBuilder(String.valueOf(it.next().toString()))).append("\n").toString()));
    }

    private Combo combo_1;
    private Combo combo;
    private Text text_3;
    private ProgressBar progress;
    private Label label_3;
    public static final String ID = "fileexplorer.views.SearchView";
    private List list;
    private File file;
    private Iterator it;


}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -