Vaadin Grid允许定义为可编辑
grid.setEditorEnabled(true);
Run Code Online (Sandbox Code Playgroud)
这使得所有可见列都可以编辑.但是,我不希望用户编辑特定列,但似乎可编辑是全部或全部.
我发现的下一个最佳解决方案是使用禁用的编辑器定义编辑器字段,这几乎可以解决问题,但用户仍然可以选择文本并移动光标(但该字段不再可编辑).
Grid.Column nameColumn = grid.getColumn("fullName");
nameColumn.setHeaderCaption("Full Name");
nameColumn.setEditorField(getNoEditableTextField());
...
private Field<?> getNoEditableTextField() {
TextField noEditableTextFiled = new TextField();
noEditableTextFiled.setEnabled(false);
return noEditableTextFiled;
}
Run Code Online (Sandbox Code Playgroud)
我相信Label不能用,因为它不是Field.
有没有更好的选择来实现这一目标?
编辑:正如aakath所说,有一种方法可以实现这一点,不能编辑列,但这样做时,单元格值会在编辑行时消失,这是不可取的.
我试图在我的Indigo RCP应用程序上使用Sleak.我已按照本指南中的步骤操作.即我已经安装了插件,将swt工具插件添加到当前插件,添加了所需的插件,修改了跟踪选项,并在我的应用程序中添加了视图folder.addView("org.eclipse.swt.tools.views.SleakView");
该视图确实显示但我在尝试使用它时仍然收到错误"设备不跟踪资源分配".
我已经在stackoverflow中尝试了关于此问题的旧问题的答案,但没有运气
Sleak(SWT和RCP):设备没有跟踪资源分配(eclipse 4.3)
我已经明确检查过调试配置中加载的.options文件是否确实具有所需的跟踪选项.
还有其他想法吗?
我正在尝试执行我最近从Eclipse Indigo转到Photon的RCP应用程序。在更改/更新了所需的库之后,我已经成功地运行了该应用程序,而没有以Eclipse应用程序(从Eclipse IDE)启动该产品的问题。
但是,当我将产品导出到本机可执行文件并启动它时,会出现几个InjectionException
!SESSION 2018-09-06 16:48:55.406 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_171
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=es_ES
Framework arguments: -clearPersistedState
Command-line arguments: -os win32 -ws win32 -arch x86 -clean -clearPersistedState
!ENTRY org.eclipse.e4.ui.workbench 4 0 2018-09-06 16:48:59.412
!MESSAGE Unable to create class 'org.eclipse.e4.ui.internal.workbench.addons.CommandProcessingAddon' from bundle '52'
!STACK 0
org.eclipse.e4.core.di.InjectionException: Unable to process "CommandProcessingAddon.broker": no actual value was found for the argument "IEventBroker".
at org.eclipse.e4.core.internal.di.InjectorImpl.reportUnresolvedArgument(InjectorImpl.java:489)
at org.eclipse.e4.core.internal.di.InjectorImpl.resolveRequestorArgs(InjectorImpl.java:480)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalInject(InjectorImpl.java:126)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:412)
at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:345)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:214)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:108)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:74)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:51) …Run Code Online (Sandbox Code Playgroud) 我为我的Vaadin 7 Grid定义了一个自定义编辑器
longColumn.setEditorField(getTextArea());
Run Code Online (Sandbox Code Playgroud)
其中getTextArea()是:
private Field<?> getTextArea() {
TextArea ta=new TextArea();
ta.setWidth("300px");
ta.setHeight("200px");
return ta;
}
Run Code Online (Sandbox Code Playgroud)
TextArea似乎具有给定的大小,但它被切割到行的高度,并且完全不可用.

是否有任何方法可以使编辑器更大,以便使用大的TextArea?