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

📄 browserwindowadvisor.java

📁 基于eclipse|rcp的浏览器,另完成加入了收藏夹功能
💻 JAVA
字号:
/*******************************************************************************
 * Copyright (c) 2004, 2006 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.rcp.browser;

import org.eclipse.swt.graphics.Point;
import org.eclipse.ui.application.ActionBarAdvisor;
import org.eclipse.ui.application.IActionBarConfigurer;
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
import org.eclipse.ui.application.WorkbenchWindowAdvisor;

/**
 * Configures the browser window using the given window configurer.
 * 
 * @since 3.1
 */
public class BrowserWindowAdvisor extends WorkbenchWindowAdvisor {

    /**
     * Creates a new browser window advisor.
     * 
     * @param configurer the window configurer
     */
    public BrowserWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
        super(configurer);
    }

    /* (non-Javadoc)
     * @see org.eclipse.ui.application.WorkbenchAdvisor
     */
    public void preWindowOpen() {
        IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
        configurer.setInitialSize(new Point(800, 600));
        
        // Default window title is the product name, so don't need to set it
        // explicitly anymore.
      configurer.setTitle("mybrowser");
        
//      configurer.setShowFastViewBars(true);
    }

    
    /* (non-Javadoc)
     * @see org.eclipse.ui.application.WorkbenchWindowAdvisor#createActionBarAdvisor(org.eclipse.ui.application.IActionBarConfigurer)
     */
    public ActionBarAdvisor createActionBarAdvisor(
            IActionBarConfigurer actionBarConfigurer) {
        return new BrowserActionBarAdvisor(actionBarConfigurer);
    }
    
//  Uncomment the code below for a custom window layout (add back the missing imports using Ctrl+Shift+O) 
/*    
      public void createWindowContents(Shell shell) {
          IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
          Menu menuBar = configurer.createMenuBar();
          shell.setMenuBar(menuBar);
          
          GridLayout shellLayout = new GridLayout();
          shellLayout.marginWidth = 0;
          shellLayout.marginHeight = 0;
          shellLayout.verticalSpacing = 0;
          shell.setLayout(shellLayout);
    
          if (!"carbon".equals(SWT.getPlatform())) { //$NON-NLS-1$
              Label sep1 = new Label(shell, SWT.SEPARATOR | SWT.HORIZONTAL);
              sep1.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
          }
          Control coolBar = configurer.createCoolBarControl(shell);
          coolBar.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
    
          Label sep2 = new Label(shell, SWT.SEPARATOR | SWT.HORIZONTAL);
          sep2.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
          
          Control pageComposite = configurer.createPageComposite(shell);
          pageComposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
    
          Label sep3 = new Label(shell, SWT.SEPARATOR | SWT.HORIZONTAL);
          sep3.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
          Control statusLine = configurer.createStatusLineControl(shell);
          statusLine.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
          shell.layout(true);
      }
*/
}

⌨️ 快捷键说明

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