HadoopPerspectiveFactory.java
上传用户:quxuerui
上传日期:2018-01-08
资源大小:41811k
文件大小:4k
源码类别:

网格计算

开发平台:

Java

  1. /**
  2.  * Licensed to the Apache Software Foundation (ASF) under one
  3.  * or more contributor license agreements.  See the NOTICE file
  4.  * distributed with this work for additional information
  5.  * regarding copyright ownership.  The ASF licenses this file
  6.  * to you under the Apache License, Version 2.0 (the
  7.  * "License"); you may not use this file except in compliance
  8.  * with the License.  You may obtain a copy of the License at
  9.  *
  10.  *     http://www.apache.org/licenses/LICENSE-2.0
  11.  *
  12.  * Unless required by applicable law or agreed to in writing, software
  13.  * distributed under the License is distributed on an "AS IS" BASIS,
  14.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15.  * See the License for the specific language governing permissions and
  16.  * limitations under the License.
  17.  */
  18. package org.apache.hadoop.eclipse;
  19. import org.eclipse.debug.ui.IDebugUIConstants;
  20. import org.eclipse.jdt.ui.JavaUI;
  21. import org.eclipse.ui.IFolderLayout;
  22. import org.eclipse.ui.IPageLayout;
  23. import org.eclipse.ui.IPerspectiveFactory;
  24. import org.eclipse.ui.console.IConsoleConstants;
  25. /**
  26.  * Creates links to the new MapReduce-based wizards and views for a MapReduce
  27.  * perspective
  28.  * 
  29.  */
  30. public class HadoopPerspectiveFactory implements IPerspectiveFactory {
  31.   public void createInitialLayout(IPageLayout layout) {
  32.     layout.addNewWizardShortcut("org.apache.hadoop.eclipse.NewDriverWizard");
  33.     layout.addNewWizardShortcut("org.apache.hadoop.eclipse.NewMapperWizard");
  34.     layout
  35.         .addNewWizardShortcut("org.apache.hadoop.eclipse.NewReducerWizard");
  36.     IFolderLayout left =
  37.         layout.createFolder("org.apache.hadoop.eclipse.perspective.left",
  38.             IPageLayout.LEFT, 0.2f, layout.getEditorArea());
  39.     left.addView("org.eclipse.ui.navigator.ProjectExplorer");
  40.     IFolderLayout bottom =
  41.         layout.createFolder("org.apache.hadoop.eclipse.perspective.bottom",
  42.             IPageLayout.BOTTOM, 0.7f, layout.getEditorArea());
  43.     bottom.addView(IPageLayout.ID_PROBLEM_VIEW);
  44.     bottom.addView(IPageLayout.ID_TASK_LIST);
  45.     bottom.addView(JavaUI.ID_JAVADOC_VIEW);
  46.     bottom.addView("org.apache.hadoop.eclipse.view.servers");
  47.     bottom.addPlaceholder(JavaUI.ID_SOURCE_VIEW);
  48.     bottom.addPlaceholder(IPageLayout.ID_PROGRESS_VIEW);
  49.     bottom.addPlaceholder(IConsoleConstants.ID_CONSOLE_VIEW);
  50.     bottom.addPlaceholder(IPageLayout.ID_BOOKMARKS);
  51.     IFolderLayout right =
  52.         layout.createFolder("org.apache.hadoop.eclipse.perspective.right",
  53.             IPageLayout.RIGHT, 0.8f, layout.getEditorArea());
  54.     right.addView(IPageLayout.ID_OUTLINE);
  55.     right.addView("org.eclipse.ui.cheatsheets.views.CheatSheetView");
  56.     // right.addView(layout.ID); .. cheat sheet here
  57.     layout.addActionSet(IDebugUIConstants.LAUNCH_ACTION_SET);
  58.     layout.addActionSet(JavaUI.ID_ACTION_SET);
  59.     layout.addActionSet(JavaUI.ID_CODING_ACTION_SET);
  60.     layout.addActionSet(JavaUI.ID_ELEMENT_CREATION_ACTION_SET);
  61.     layout.addActionSet(IPageLayout.ID_NAVIGATE_ACTION_SET);
  62.     layout.addActionSet(JavaUI.ID_SEARCH_ACTION_SET);
  63.     layout
  64.         .addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewPackageCreationWizard");
  65.     layout
  66.         .addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewClassCreationWizard");
  67.     layout
  68.         .addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewInterfaceCreationWizard");
  69.     layout
  70.         .addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewEnumCreationWizard");
  71.     layout
  72.         .addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewAnnotationCreationWizard");
  73.     layout
  74.         .addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewSourceFolderCreationWizard");
  75.     layout
  76.         .addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewSnippetFileCreationWizard");
  77.     layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.folder");
  78.     layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.file");
  79.     layout
  80.         .addNewWizardShortcut("org.eclipse.ui.editors.wizards.UntitledTextFileWizard");
  81.     // CheatSheetViewerFactory.createCheatSheetView().setInput("org.apache.hadoop.eclipse.cheatsheet");
  82.   }
  83. }