如果说只需要改变RCP的皮肤可以参照IBM上的Eclipse程序界面美化技术
http://www.ibm.com/developerworks/cn/opensource/os-cn-ecl-rcprich/
如果想自定义RCP的外观就得用到presentationFactories,presentationFactories是eclipse为editor以及view提供的一个外观工厂,在eclipse官网上推荐的书中就提到过这么个工厂,今天再看MP3MANAGER源代码的时候发现实现起来也挺简单的,不过我还是习惯eclipse风格,所以没将应用的外观改变,之前也一直在寻找改变RCP外观的方法,昨天网友告诉我IBM上有我就去看了下,就是简单的变换了图片和背景颜色,也就是个SWT的皮肤而已,下面我就直接贴代码演示presentationFactories的实现方法
首先就是Presentation 类:
/*******************************************************************************
* Copyright (c) 2009 Siemens AG
*
* 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:
* Kai T枚dter - initial API and implementation
*******************************************************************************/
package com.siemens.ct.mp3m.ui.presentation;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;