3C科技 娛樂遊戲 美食旅遊 時尚美妝 親子育兒 生活休閒 金融理財 健康運動 寰宇綜合

Zi 字媒體

2017-07-25T20:27:27+00:00
加入好友
使用Eclipse Workbench的小技巧 Perspective 設計 public class MainPerspective implements IPerspectiveFactory { public static String ID = "com.slab.MainPerspective"; public void createInitialLayout(IPageLayout layout) { layout.setEditorAreaVisible(false); layout.addView(TreeView.ID, IPageLayout.TOP, 0.25f, layout.getEditorArea()); layout.setEditorAreaVisible(false); layout.addView(LoginView.ID, IPageLayout.LEFT, 1f, layout.getEditorArea()); layout.addView(WelcomeView.ID, IPageLayout.LEFT, 1f, layout.getEditorArea()); IViewLayout vl = layout.getViewLayout(WelcomeView.ID); // 設定View不可關閉 layout.getViewLayout(WelcomeView.ID).setCloseable(false); // 設定View不可移動 layout.getViewLayout(WelcomeView.ID).setMoveable(false); } } 使用 Action 顯示 Perspective ActionFactory.CLOSE_PERSPECTIVE.create(PlatformUI.getWorkbench().getActiveWorkbenchWindow()).run(); try { PlatformUI.getWorkbench().showPerspective("com.slab.MainPerspective", PlatformUI.getWorkbench().getActiveWorkbenchWindow()); } catch (WorkbenchException e) { e.printStackTrace(); }  

本文由toright提供 原文連結

寫了 5860316篇文章,獲得 23313次喜歡
精彩推薦