八进制

少年壮志无烟抽

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
  244 随笔 :: 0 文章 :: 3241 评论 :: 14 引用

在.product文件里指定“Add a progress bar”和进度条的尺寸以后,进度条很可能并未如你设想中出现在Splash图片上,解决的方法如下:

1、在.product文件同一目录里创建customization.ini文件,包含这样的文本内容:org.eclipse.ui/SHOW_PROGRESS_ON_STARTUP=true

2、在plugin.xml里的org.eclipse.core.runtime.products扩展点下的对应product下添加属性preferenceCustomization,值为customization.ini;这个扩展点一般是在编辑.product文件后导出RCP时自动生成的。

3、为让所有的修改生效,可能需要以-clean方式启动你的RCP程序。

4、进度条的位置和大小也可直接在plugin.xml里指定,同样是对应product下的属性,分别为startupProgressRect和startupMessageRect,属性值例如“10,290,200,16”,前两个数字是位置,后两个是尺寸。


BTW,在3.3版本的Eclipse里可能会免去在customization.ini文件里做设置的步骤。

参考:

http://www.eclipsezone.com/eclipse/forums/m92055175.html

http://eclipsezone.com/eclipse/forums/m92053781.html

posted on 2006-10-31 21:04 八进制 阅读(4886) 评论(25)  编辑 收藏 网摘 所属分类: EclipseRCP

评论

多谢八进制,俺正在学做RCP,又让学到了一个RCP的特性
  回复  引用    

#2楼 2007-02-05 17:57 czhcc[未注册用户]
但在导出后没有进度条了。不知道大家是不是这样?
  回复  引用    

#3楼 2007-02-05 17:59 czhcc[未注册用户]
不好意思,没导出时没包含INI文件。
  回复  引用    

#4楼 2007-03-27 18:53 Autumn[未注册用户]
八进制,你好!
我最近遇到一个问题,需要周期(例如每1分钟)刷新TableViewer控件,
以显示一个相对变化较快的数据表数据。
当我在ui线程中创建一个线程周期读取数据表,将数据setInput时,抛出
SWTException。
请问此类周期刷新控件的问题该怎样解决?

  回复  引用    

#5楼[楼主] 2007-03-30 16:23 八进制      
试试用Display.asyncExec(Runnable),非Display线程不能修改控件内容。
  回复  引用  查看    

#6楼 2007-05-02 17:03 Dollyn[未注册用户]
为什么只有在导出以后才出现?用launch the product不行?
  回复  引用    

#7楼 2007-10-16 18:12 z[未注册用户]
在rcp启动前添加图片和进度条,是否在Splash中对Add a progress bar和Add a progress message打勾。之后如何做才能让导出的rcp项目中也出现图片和进度条。帖子介绍的过程,我也加进去了,不知道在导出时,还需要做什么特别的操作。例如楼上那个说的加*.ini文件。是我们自己建立的那个customization.ini文件吗?应该如何包含近来?
  回复  引用    

#8楼 2007-10-17 09:49 z[未注册用户]
问题找到答案了:注意:现在虽然添加了plugin_customization.ini,但是在发布产品的时候还是不会将这个文件添加上去。所以您需要在plugin.xml文件的编辑器的build页面中,将plugin_customization.ini文件选上。
就不麻烦八进制了,但是还是感谢你的帖子。把答案贴在这,希望对和我有一样问题的人有所帮助。

  回复  引用    

#9楼 2007-10-26 21:15 fxfx[未注册用户]
八进制,你好!
我这有个问题。一个项目a的bundle,其中需要引用项目b中的bundle,而项目b中的bundle又需要引用a中的,这种情况下在eclipse中可以通过
window->preferences->java->building 中的circular dependencies 重置为waring,这样一来在eclipse环境中可以运行。

但是,当我需要将整个项目打包成product时即 eclipse product export wizard 打包,却出现错误

a cycle was detected when geneerating the classpath projecta_1.0 projectb_1.0 projecta_1.0

这样的错误。
所以请问八进制兄,这样的情况是否可以解决??
谢谢,请回复!!!!

  回复  引用    

#10楼[楼主] 2007-10-27 09:17 八进制      
一般遇到这种情况可以创建一个新的bundle(如c),让a和b引用c来解决cycle。
  回复  引用  查看    

#11楼 2007-10-29 21:51 fxfx[未注册用户]
我明白你的意思。如果c是一个可接受服务注册的基础项目。其他所有的bundle都到这来注册和获取服务。
但八进制能否给一个这样的例子啊。最好用扩展点的形式。
谢谢!!

  回复  引用    

#12楼 2007-10-31 15:06 fxfx[未注册用户]
按照你的说明,我重构了一下我的项目。但好像依然会存在这样的问题。

比如:
------c-----代表一个服务注册点
/ \
a注册 b注册

a注册一个服务s1,同时作为b中s2服务的消费者
b注册一个服务s2,同时作为a中s1服务的消费者
那么,a,b都扩展c的一个服务扩展点。
可是,在a或b接受对方的服务的时候,都需要引用对方向外提供的一个接口。
那么,这样还是会造成循环resolve啊。
我怎么也搞不懂,烦请八进制兄能再给好好说说,谢谢!

  回复  引用    

#13楼[楼主] 2007-11-01 18:05 八进制      
a消费s2的部分应该不是s1本身吧,这样就可以把a里实现s1的部分拿出来作为c,同理可以把b里实现s2的部分也放到c,这样就是a,b都依赖c了。
  回复  引用  查看    

#14楼 2007-11-20 21:26 zw[未注册用户]
八进制,你好。
我这个帖子法在这里其实不是很合适,但是赫赫,没找到你关于SWT,table的帖子,就发到这里了。麻烦你帮我看看好吗。。

给Table设置自定义行高出现的bug,很奇怪。
下面是完整的demo代码,:)
问题是有那段给table设置行高的代码段(注释掉了),就会删除抛错。没有的话,就一切OK。。真是不知道为什么。。

public class ww {

private Table table;
protected Shell shell;
private Composite composite;
/**
* Launch the application
* @param args
*/
public static void main(String[] args) {
try {
ww window = new ww();
window.open();
} catch (Exception e) {
e.printStackTrace();
}
}

/**
* Open the window
*/
public void open() {
final Display display = Display.getDefault();
createContents();
shell.open();
shell.layout();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
}

/**
* Create contents of the window
*/
protected void createContents() {
shell = new Shell();
shell.setSize(471, 500);
shell.setText("SWT Application");
composite = new Composite(shell,SWT.NONE);
composite.setSize(471, 500);

final Group group = new Group(composite, SWT.NONE);
group.setText("编辑参数");
group.setBounds(48, 297, 383, 145);

table = new Table(group,SWT.BORDER | SWT.V_SCROLL | SWT.FULL_SELECTION);
table.setLinesVisible(true);
table.setHeaderVisible(true);
table.setBounds(10, 24, 373, 121);

String[] tableHeader = { "组号", " 类型 ", " X ", " Y " };
for (int i = 0; i < tableHeader.length; i++) {
TableColumn tc = new TableColumn(table, SWT.NONE);
tc.setText(tableHeader);
tc.setMoveable(true);
}
for (int i = 0, n = table.getColumnCount(); i < n; i++) {
table.getColumn(i).pack();
}

// 这个是给每行增加高度,有这段就抛错。。。
// table.addListener(SWT.MeasureItem, new Listener() {
// public void handleEvent(Event event) {
// event.height = (int)(event.gc.getFontMetrics().getHeight() * 1.5);
// }
// });


final Button button = new Button(composite, SWT.NONE);
button.setText("+");
button.setBounds(263, 252, 48, 22);
button.addSelectionListener(new SelectionListener(){

public void widgetDefaultSelected(SelectionEvent e) {}

public void widgetSelected(SelectionEvent e) {
TableItem item = new TableItem(table,SWT.NONE);
item.setText(new String[] { 1 +"", "", "", "" });

}

});


final Button button_5 = new Button(composite, SWT.NONE);
button_5.setText("-");
button_5.setBounds(340, 249, 48, 28);
button_5.addSelectionListener(new SelectionListener(){

public void widgetDefaultSelected(SelectionEvent e) {}

public void widgetSelected(SelectionEvent e) {
if(table.getSelectionIndex() >=0)
{
table.clear(table.getSelectionIndex()); //先清除该行的值
table.remove(table.getSelectionIndex());//再删掉该行。
}

}

});


}

}


我debug了一下,发现SWT.MeasureItem好像会让程序不停的调用设置行高的这段代码。

  回复  引用    

#15楼 2008-05-18 02:00 傻羊[未注册用户]
你好楼主,我的RCP程序已经实现了EMF和GMF editor,现在想把ATL整合进来,进行需要的模型转换。但是我在RCP里升级后,不知道怎么新建或调用ATL文件。
另外,ATL在Eclipse里的运行方法是右键ATL文件,打开run dialog,选择其中的ATL Transformation,进行相关设置。但是RCP里没有open run dialog,我不知道应该用什么方法运行已存在的atl文件,望楼住赐教!!!

  回复  引用    

#16楼[楼主] 2008-05-20 14:07 八进制      
我记得ATL有个文档(或者是新闻组里某个帖子)专门说这个的,但当时我没试,步骤好像很多,要设置不少环境。sorry一时找不到了。
  回复  引用  查看    

#17楼 2008-05-25 19:36 傻羊[未注册用户]
@八进制
好的,多谢!我再去看看。
另外想把C/C++ editor放在我的RCP里,想法是在GMF editor的一个属性栏里设个按钮,点开后能自动打开一个C/C++ editor,需要CDT的支持。 现在我能按一个按钮打开一个txt editor了,但是打开java或C editor还没有尝试成功。Eclipse里有一篇文章简短地把用程序启动editor的函数说了一下: http://wiki.eclipse.org/FAQ_How_do_I_open_an_editor_programmatically%3F
但我还是不太明白怎样设置才能打开java 或 C editor。

望赐教!!!提前谢过~~~

  回复  引用    

#18楼 2008-05-27 09:09 傻羊[未注册用户]
不好意思,又过来请教了~~~
打开C editor的代码我基本搞定了。输出产品后,我通过RCP的Update来升级CDT组件,除了核心组建外,另外又选了两个升级。在RCP的New里可以新建C/C++项目,但是每当新建完C/C++项目或文件,或者是写完代码build的时候,总是会报出类似下面的null argument错误,虽然都可以运行,但是文件全是出错状态。问题出在哪里呢?是少了什么plugin吗?望赐教!


========================
org.eclipse.core.runtime.AssertionFailedException: null argument:
at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:84)
at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:72)
at org.eclipse.jface.viewers.StructuredSelection.<init>(StructuredSelection.java:66)
at org.eclipse.ui.internal.navigator.CommonNavigatorManager$2.run(CommonNavigatorManager.java:101)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.ui.internal.navigator.CommonNavigatorManager$UpdateActionBarsJob.runInUIThread(CommonNavigatorManager.java:94)
at org.eclipse.ui.progress.UIJob$1.run(UIJob.java:94)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3659)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3296)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at sdu.mci.seg.tools.stateMachine.application.diagram.application.ApplicationApplication.run(ApplicationApplication.java:19)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethod(EclipseAppContainer.java:572)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:171)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)

  回复  引用    

八爷,请问windows下发布的RCP产品能不能在Unix下运行
  回复  引用    

#20楼[楼主] 2008-06-12 20:41 八进制      
我觉得可以,在.product文件里不是有各种平台下的发布参数吗?但我同时记得曾经在新闻组里看到关于发布linux下运行的rcp的问题,印象里需要安装delta pack。
  回复  引用  查看    

#21楼 2009-01-07 15:22 高[未注册用户]
八进制。新年好:
我有两个问题想请教下:
1.我的RCP程序在添加程序在线升级功能后,Preferences窗体中增加了一个“install/update”节点,而我想隐藏或者不显示它,我该怎么做呢?
2.我在progress dialog中选择了"always run in backgroud"后,不会再有progress dialog弹出,那我怎么使它再次弹出呢?

先谢谢了!

  回复  引用    

#22楼 2009-01-07 16:00 高[未注册用户]
第二个问题解决了
WorkbenchPlugin
.PlatformUI
.getPreferenceStore()
.setValue( IPreferenceConstants.RUN_IN_BACKGROUND, false);
就可以了。

  回复  引用    

#23楼[楼主] 2009-01-18 23:50 八进制      
@高
关于你的第一个问题,我查到两种方法:
1、写一段代码
PreferenceManager pm = window.getWorkbench().getPreferenceManager();
pm.remove("org.eclipse.update.internal.ui.preferences.MainPreferencePage");
2、定义一个activities扩展,然后禁用
具体见这个链接http://dev.eclipse.org/newslists/news.eclipse.platform.rcp/msg16168.html" target="_new">http://dev.eclipse.org/newslists/news.eclipse.platform.rcp/msg16168.html

  回复  引用  查看    

@八进制
楼主,想请教个问题:
假如我在启动的时候要先后做以下几件事情:
1、检查更新
2、加载用户配置
那如何做到启动的进度条上的文字,动态显示是在检查更新还是加载用户配置呢?? 谢谢

  回复  引用    

#25楼[楼主] 2009-02-03 12:51 八进制      
@air_star
据我所知Eclipse没有提供这样详细的定制。

  回复  引用  查看    

发表评论

昵称: [登录] [注册]

主页:

邮箱:(仅博主可见)

评论内容:

  登录  注册

[使用Ctrl+Enter键快速提交评论]

0 545974


相关文章:

相关链接: