我已经实现了一个 SWT 表,其中一列中有一个按钮小部件。单击按钮后,我将删除整行。但我不明白如何刷新/重绘/更新表格。
Table processListTable;
TableItem tableItem;
Image deleteImage = Activator.getImageDescriptor("icons/trash.gif").createImage();
private void addRowInTable() {
tableItem = new TableItem(processListTable, SWT.FILL);
tableItem.setText(0, "value 1");
tableItem.setText(1, "value 2");
TableEditor editor = new TableEditor(processListTable);
final Button deleteButton = new Button(processListTable, SWT.PUSH | SWT.FILL);
deleteButton.pack();
editor.minimumWidth = deleteButtonButton.getSize().x;
editor.horizontalAlignment = SWT.CENTER;
editor.setEditor(deleteButtonButton, tableItem, 2);
deleteButtonButton.setImage(deleteImage);
deleteButtonButton.addListener(SWT.Selection, new SelectionListener(tableItem, checkButton));
}
class SelectionListener implements Listener {
TableItem item;
Button deleteButton;
public SelectionListener(TableItem item, Button deleteButton) {
this.item = item;
this.deleteButton = deleteButton;
}
public void …Run Code Online (Sandbox Code Playgroud) 我在运行时创建一个 MWindow
MWindow window = _modelService.createModelElement(MWindow.class);
window.setWidth(200);
window.setHeight(300);
// add new Window to the application
// @Inject
// MApplication _application;
_application.getChildren().add(window);
Run Code Online (Sandbox Code Playgroud)
比我添加一个部分
EModelService windowModelService = window.getContext().get(EModelService.class);
EPartService windowPartService = window.getContext().get(EPartService.class);
// find part if exists
MPart part = windowPartService.findPart("partId");
if (part == null) {
// create if not exists
part = windowPartService.createPart("partId");
}
// Required if initial not visible
part.setVisible(true);
// Show the part
MPart newPart = windowPartService.showPart(part, PartState.VISIBLE);
Run Code Online (Sandbox Code Playgroud)
但我不知道在不再使用该窗口后如何关闭或处置它。Mwindow 没有关闭/处置或退出功能。如果我尝试简单地从应用程序中删除它,我会得到 npe。
如何摆脱窗户?
我目前面临的是我们在Windows 2008服务器R2上的Citrix环境中运行的一些Eclipse应用程序中的异常访问冲突.
调用开始org.eclipse.swt.widgets.FileDialog.open(),调用方法org.eclipse.swt.internal.win32.OS.GetSaveFileNameW然后转到本机库.它失败,并# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x68931bab, pid=9208, tid=7616
与siginfo: ExceptionCode=0xc0000005, ExceptionInformation=0x00000008 0x68931bab
分析创建的minidump,我结束了 thumbcache.dll
thumbcache.dll!CThumbnailCache::CThumbnailCache(int) Unknown
thumbcache.dll!ThumbnailCacheCreateInstance(int,struct _GUID const &,void * *) Unknown
thumbcache.dll!CThumbCacheClassFactory::CreateInstance(struct IUnknown *,struct _GUID const &,void * *) Unknown
ole32.dll!CServerContextActivator::CreateInstance(IUnknown * pUnkOuter, IActivationPropertiesIn * pInActProperties, IActivationPropertiesOut * * ppOutActProperties) Line 1000 C++
ole32.dll!ActivationPropertiesIn::DelegateCreateInstance(IUnknown * pUnkOuter, IActivationPropertiesOut * * ppActPropsOut) Line 1917 C++
ole32.dll!CApartmentActivator::CreateInstance(IUnknown * pUnkOuter, IActivationPropertiesIn * pInActProperties, IActivationPropertiesOut * * ppOutActProperties) C++
ole32.dll!CProcessActivator::CCICallback(unsigned long dwContext, IUnknown * pUnkOuter, ActivationPropertiesIn …Run Code Online (Sandbox Code Playgroud) 我正在 Application.e4xmi 中添加按键绑定。在绑定表(在窗口和对话框中)->BindingTable->KeyBinding 中。在序列字段中,我使用 M1+I,在命令字段中,我输入命令 ID 当我运行应用程序并按 CTRL+I 时。该命令未执行。请帮我。
我想使用PDE无头构建来构建Eclipse RCP应用程序。当我运行构建的Ant脚本时,它失败并显示以下错误消息:
failed to create task or type eclipse.generateFeature
Cause: The name is undefined.
Run Code Online (Sandbox Code Playgroud) 我正在使用 eclipse 插件,其中Project Explorer视图中存在的项目的工作区名称与项目的实际路径不同。因此,D:\test当我尝试获取项目位置时,考虑一个位于的项目,它指向D:\test_plugin_specific_suffix.
有没有办法从绝对路径(指向本地路径D:\test\testfile.txt)获取 IFile ?
我想创建一个指向我有绝对路径的特定文件的超链接。当我单击超链接上的控制台时,它应该在编辑器中打开该文件。
我正在为Eclipse创建一个小插件来(重新)以编程方式启动LaunchConfigurations.
我可以启动配置,但是我希望增强以下代码,以便在启动之前首先关闭具有给定名称的所有正在运行的配置.
public void restartLaunchConfiguration(String configurationName) throws Exception {
final ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
for(final ILaunchConfiguration cfg : manager.getLaunchConfigurations()){
final String cfgName = cfg.getName();
if(!configurationName.equals(cfgName)) continue;
cfg.launch("debug", null);
break;
}
}
Run Code Online (Sandbox Code Playgroud)
如何获取所有正在运行的配置?
如何停止正在运行的配置?
有办法做到以下几点吗?
我有一个树项目图标,例如:
http://cdn1.iconfinder.com/data/icons/DarkGlass_Reworked/128x128/actions/contents.png
当某个动作发生时,我想在其上添加一个标志(标志是一个将放在其上的图标)
如果旗帜是正确的标记,那么它应该是这样的
http://store2.up-00.com/June12/yk105816.png
简单地说,我可以在动作上添加图像吗?
注意:我知道我可以通过另一种方式在行动时在两个图像之间进行更改.但是我将不得不在PS的油漆上做一些工作.
抱歉图像的链接和新用户一样,我无法发布图像
我想在执行操作时打开包含表的View.
我可以通过viewId打开该代码的视图:
display.asyncExec(new Runnable(){
public void run() {
ApplicationGIS.getView(true, viewId);
}});
Run Code Online (Sandbox Code Playgroud)
此视图的id在plugin.xml上定义,但我必须将一些参数传递给此视图上的表.我可以以编程方式创建我的自定义视图,但这次我无法打开它,因为我没有它的id.这是我的观点类:
public class MyCustomView extends ViewPart {
private Text text;
private Table table;
private TableViewer tableViewer;
@Override
public void createPartControl(Composite parent) {
// TODO Auto-generated method stub
parent.setLayout(new GridLayout(4, false));
Composite composite = new Composite(parent, SWT.NONE);
composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 4, 1));
composite.setLayout(new GridLayout(2, false));
text = new Text(composite, SWT.BORDER);
text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
Composite composite_1 = new Composite(composite, SWT.NONE);
composite_1.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, …Run Code Online (Sandbox Code Playgroud) eclipse-rcp ×10
eclipse ×5
swt ×5
java ×4
eclipse-pde ×2
e4 ×1
key-bindings ×1
pdf ×1
rcp ×1
tree ×1
view ×1
windows ×1