- 浏览: 534345 次
- 性别:
- 来自: 深圳
文章分类
最新评论
-
gaolegao2008:
如果报 is_volum 列名找不到之类的,我是从新部署了一个 ...
spring quartz 定时器报错 -
gaolegao2008:
部署到linux上时,还有一种情况就是mysql数据库区分大小 ...
spring quartz 定时器报错 -
qq123zhz:
yahier 写道 对我有帮助,但我看的一个demo程序,却没 ...
spring quartz 定时器报错 -
qq123zhz:
这个要在eclipse的插件环境下运行的,你不懂eclipse ...
GEF 自动布局 -
qq123zhz:
这个很久了,不记得啥时候写的了
json转为Map
/******************************************************************************* * Copyright (c) 2008, Ralf Ebert * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Ralf Ebert nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY Ralf Ebert ''AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL Ralf Ebert BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ package de.ralfebert.rcp.tools.preferredperspective; /** * Let Workbench parts implement this interface if you want * {@link PreferredPerspectivePartListener} to automatically activate the * preferred perspective on part activation. */ public interface IPrefersPerspective { /** * @return the preferred perspective of this part or null if no perspective * is preferred. */ String getPreferredPerspectiveId(); }Add PreferredPerspectivePartListener to your application. This class is responsible for switching the perspective upon activation of a part implementing IPrefersPerspective. /******************************************************************************* * Copyright (c) 2008, Ralf Ebert * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Ralf Ebert nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY Ralf Ebert ''AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL Ralf Ebert BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ package de.ralfebert.rcp.tools.preferredperspective; import java.util.logging.Logger; import org.eclipse.swt.widgets.Display; import org.eclipse.ui.IPartListener; import org.eclipse.ui.IPerspectiveDescriptor; import org.eclipse.ui.IStartup; import org.eclipse.ui.IWorkbenchPart; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.WorkbenchException; /** * PreferredPerspectivePartListener is to be registered using the extension * point "org.eclipse.ui.startup". It will register itself as listener for the * activation of parts. When a part which implements IPrefersPerspective is * activated it will activate the preferred perspective of this part. */ public class PreferredPerspectivePartListener implements IPartListener, IStartup { private static final Logger log = Logger.getLogger(PreferredPerspectivePartListener.class); public void partActivated(IWorkbenchPart part) { refresh(part); } public static void refresh(final IWorkbenchPart part) { if (!(part instanceof IPrefersPerspective)) { return; } final IWorkbenchWindow workbenchWindow = part.getSite().getPage().getWorkbenchWindow(); IPerspectiveDescriptor activePerspective = workbenchWindow.getActivePage().getPerspective(); final String preferredPerspectiveId = ((IPrefersPerspective) part) .getPreferredPerspectiveId(); if (preferredPerspectiveId == null) { return; } if (activePerspective == null || !activePerspective.getId().equals(preferredPerspectiveId)) { // Switching of the perspective is delayed using Display.asyncExec // because switching the perspective while the workbench is // activating parts might cause conflicts. Display.getCurrent().asyncExec(new Runnable() { public void run() { log.debug("Switching to preferred perspective " + preferredPerspectiveId + " for " + part.getClass()); try { workbenchWindow.getWorkbench().showPerspective(preferredPerspectiveId, workbenchWindow); } catch (WorkbenchException e) { log.warn("Could not switch to preferred perspective " + preferredPerspectiveId + " for " + part.getClass(), e); } } }); } } public void earlyStartup() { Display.getDefault().asyncExec(new Runnable() { public void run() { try { PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() .addPartListener(new PreferredPerspectivePartListener()); } catch (Exception e) { log.error(e.getMessage(), e); } } }); } public void partBroughtToTop(IWorkbenchPart part) { // nothing to do } public void partClosed(IWorkbenchPart part) { // nothing to do } public void partDeactivated(IWorkbenchPart part) { // nothing to do } public void partOpened(IWorkbenchPart part) { // nothing to do } }
<extension point="org.eclipse.ui.startup"> <startup class="de.ralfebert.rcp.tools.preferredperspective.PreferredPerspectivePartListener"/> </extension>
引用地址:http://www.ralfebert.de/blog/eclipsercp/auto_perspective_switch/
http://eclipse.dzone.com/articles/disable-or-enable-actions-sets
- perspectiveActionSets.zip (13.2 KB)
- 下载次数: 14
发表评论
-
eclipse jdt builder的资料
2014-07-11 15:27 939eclipse jdt关于builder的英文资料。。。。 ... -
eclipse 插件开发 Setting the Java build path
2014-06-04 11:00 1216JDT Plug-in Developer Guide & ... -
RCP MessageConsole设置显示的最大行数
2013-09-05 11:34 966MessageConsole.setWaterMarks(5 ... -
RCP FileSystem 文件系统
2013-02-19 10:42 1381public static File toLocalFile ... -
eclipse4.x 去掉quick access
2013-01-11 14:57 4057/** * 去掉quick access * ... -
RCP 分页组件
2012-12-26 16:59 1498http://www.eclipse.org/nebula/w ... -
jdt 核心知识
2012-11-27 21:39 1277jdt官方核心知识...................... ... -
jdt 创建java工程,生成代码,运行main方法
2012-11-27 10:50 2345public static IJavaProje ... -
SWT 隔行换色-自动宽高调整
2012-10-16 17:32 1710** * 创建:ZhengXi 2009-8-4 */ ... -
RCP 为action添加操作进度条
2012-10-16 13:59 1292public class StartAction extend ... -
RCP 视图交互 ISelectionProvider和ISelectionListener,只响应鼠标左键
2012-10-10 18:36 2247有时候一个视图( V ... -
采用jface dataBinding来实现内容填充
2012-07-27 15:42 1192//采用jface dataBinding来实现内容填充 ... -
RCP 在视图中获得首选项修改后的结果
2012-07-27 15:35 1152在视图或者编辑器中加入如下代码: Activator.get ... -
RCP获得eclipse的相关位置
2012-07-24 11:14 1074InternalPlatform.getDefault().g ... -
swt/jface 获取table所有的列的值
2012-07-24 09:24 1421TableItem [] items = table.get ... -
org.eclipse.swt.SWTException: Subclassing not allowed
2012-07-19 15:09 1241org.eclipse.swt.SWTException: S ... -
Job found still running after platform shutdown.
2012-06-29 16:40 1855Job found still running after p ... -
eclipse插件开发 打开指定透视图
2012-06-12 14:08 1448打开透视图 PlatformUI.getWorkbench( ... -
eclipse 插件开发,报错No property tester contributes a property....
2012-06-12 11:29 2111ENTRY org.eclipse.ui.navigator ... -
eclipse JDT相关知识
2012-06-11 10:14 3991Java项目模型 Eclipse的项目有很多种,包括J ...
相关推荐
默认情况下,Eclipse RCP提供了标准的透视图切换方式,但开发者可以根据需求进行自定义。下面我们将逐步解析这个过程: 1. **理解org.eclipse.ui.presentationFactories扩展点**: `org.eclipse.ui....
3. **透视图切换器** - 位于工具栏最右侧。 - 可以通过点击透视图切换器按钮来展示不同的透视图供用户选择。 - **透视图**是Eclipse中的一种布局模式,用于组织不同的开发任务界面。 - 用户可以自定义不同的透视...
6. **透视图(Perspective)**:Eclipse的透视图功能允许用户根据当前的工作需求定制工作区布局,例如,可以切换到Java透视图进行编程,或者切换到调试透视图进行程序调试。 7. **市场(Eclipse Marketplace)**:...
同时,Eclipse的透视图(Perspective)概念使得开发者可以根据当前的工作需求切换不同的视图布局,如Java开发透视图、调试透视图等。 对于初学者,Eclipse的中文版提供了一份详尽的中文帮助文档,覆盖了从安装到...
源码分析能让我们明白如何定义新的透视图,以及如何在不同透视图之间切换。 4. **视图(View)和编辑器(Editor)**:Eclipse的视图和编辑器提供了展示和编辑项目信息的界面。源码中,你可以学习如何创建自定义视图...
- Eclipse的核心是其工作台,它由多个视图(View)、编辑器(Editor)和透视图(Perspective)组成,可根据不同开发任务灵活切换。 3. **透视图(Perspective)**: - 透视图是一种组织工作空间的方式,如Java...
9. **透视图**:Eclipse的透视图功能允许用户根据不同的工作需求切换不同的视图布局,例如Java透视图、调试透视图和资源透视图等。 10. **市场与更新**:Eclipse Marketplace是获取和安装插件的平台。用户可以在...
5. **替换透视图切换器**:EclipseSource Blog中提到的话题可能涉及如何自定义RCP应用的透视图切换逻辑,这可能涉及到重写默认的透视图切换行为,提供更加个性化的用户体验。 6. **视图管理**:RCP小技巧可能包括...
8. **透视图(Perspective)**:透视图允许用户根据当前任务切换不同的视图布局,比如Java开发者常用的Java透视图,以及用于测试的JUnit透视图。 9. **任务(Task)**:Eclipse支持任务管理,用户可以创建、跟踪和...
通过切换透视图,可以快速改变工作台的布局以适应不同的任务。 - **重新排列视图和编辑器**:用户可以根据自己的喜好重新排列视图和编辑器的位置,以提高工作效率。例如,可以并排放置编辑器,或将特定的视图固定在...
4. **透视图(Perspective)**:透视图定义了Eclipse窗口中显示的视图和编辑器布局,例如Java透视图、调试透视图和XML透视图,可以根据不同的开发任务选择适合的视角。 5. **编辑器(Editor)**:编辑器用于编写...
你可以通过“窗口”菜单中的“透视图”选项来切换或创建新的透视图。 3. **创建一个项目** - 在Eclipse中,项目是代码组织的基本单元。要创建一个新的Java项目,你需要选择“文件”->“新建”->“Java项目”。输入...
`org.eclipse.ui.examples`可能包括不同类型的透视图示例,展示如何创建和切换不同的工作空间配置。 至于导入和运行示例,按照描述,你需要将下载的I20150728-0800压缩包解压后导入到Eclipse环境中。然后,选择项目...
同时,Eclipse的透视图(Perspective)功能允许你根据不同的工作场景切换界面布局,例如Java开发透视图、调试透视图等。 总之,Eclipse作为一款功能强大的Java开发工具,其易用性和灵活性使其成为开发者首选的IDE之...
- **透视图切换器**:用于在不同透视图间切换,以适应不同的开发任务。 - **工作台工具栏**:根据透视图变化,提供特定的工具。 - **视图工具栏**:位于各个视图的顶部,用于控制视图内的内容。 - **快速视图栏*...
通过"Window" -> "Perspective" -> "Open Perspective"切换或创建新的透视图。 九、资源管理 Eclipse的资源管理功能强大,支持文件和项目的导入导出、搜索、重命名、删除等操作。"Package Explorer"和"Project ...
其特有的“透视图”(Perspective)功能,可以根据开发者的不同需求,灵活切换不同的工作视图,如Java开发透视图、Web开发透视图等。 接下来,我们关注JDK1.8,即Java Development Kit的第8个主要版本。JDK是Oracle...
- **透视图(Perspective)**:透视图是Eclipse中视图和编辑器的组合,提供不同类型的开发环境。你可以通过Window菜单切换透视图(Window → Open Perspective → Other)。例如,Java开发通常使用Java透视图,它...
可以通过`Window > Open Perspective > Java`来切换到Java透视图。 3. **创建项目** 要创建一个新的Java项目,选择`File > New > Project`,然后在弹出的向导中选择`Java Project`。在项目名称中输入,如...