logoutview.java

来自「用Eclipse开发的桥吊无线管理系统.希望对大家有帮助:)」· Java 代码 · 共 95 行

JAVA
95
字号
/*
 * Zjg's New Class Files
 * 
 * Created On 2005-7-26
 * Copyright 2005 The Linkingstar Developement Team
 */
package login_QD.view;

import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.part.ViewPart;

import dialogs_QD.LogoutFalseDialog;

public class LogoutView extends ViewPart {
    public static IWorkbenchWindow wd;

    public static final String ID = "login_QD.view.LogoutView";

    public Shell shell;

    public static IWorkbenchPartSite vp;

    public void createPartControl(Composite parent) {
        vp = super.getSite();
        shell = this.getSite().getShell();
        GridLayout gl = new GridLayout();
        parent.setLayout(gl);

        // FillLayout filllayout = new FillLayout();
        // parent.setLayout(filllayout);

        final Color bkColor = new Color(Display.getCurrent(), 155, 155, 255);
        // parent.setBackground(bkColor);
        Label l2 = new Label(parent, SWT.NONE);
        Label l3 = new Label(parent, SWT.NONE);
        Label l4 = new Label(parent, SWT.NONE);
        Label l5 = new Label(parent, SWT.NONE);
        Label l6 = new Label(parent, SWT.NONE);
        Label l7 = new Label(parent, SWT.NONE);
        Label l8 = new Label(parent, SWT.NONE);
        Label l9 = new Label(parent, SWT.NONE);

        Label l1 = new Label(parent, SWT.CENTER);
        final Font font = new Font(Display.getCurrent(), "隶书", 26, SWT.CENTER);
        l1.setFont(font);
        l1.setText("     服务器正在接收注销信息,请耐心等待。。。。。。");
        l1.setForeground(Display.getCurrent().getSystemColor(
                SWT.COLOR_DARK_BLUE));
        // l1.setBackground(new Color(Display.getCurrent(), 155, 155, 255));

    }

    public void idVerifyLogout(boolean true_false) {

        System.out.println("进入了判断函数");
        if (true_false) {
            try {
                // tip 从一个view调用另一个view,并且返回另一个view的句柄

                IWorkbenchWindow window = getSite().getWorkbenchWindow();
                window.getActivePage().hideView(
                        window.getActivePage().findView(
                                login_QD.view.LogoutView.ID));

                IViewPart viewPart = getSite().getPage().showView(LoginView.ID,
                        null, IWorkbenchPage.VIEW_VISIBLE);

            } catch (Exception e1) {
                e1.printStackTrace();
            }
        } else {

            new LogoutFalseDialog(shell);

        }

    }

    public void setFocus() {

    }

}

⌨️ 快捷键说明

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