从重写的createWindowContents访问org.eclipse.swt.widgets.Text

时间:2023-01-12 15:36:02

I have overridden the method createWindowContents in my ApplicationWorkbenchWindowAdvisor class.

我在ApplicationWorkbenchWindowAdvisor类中重写了createWindowContents方法。

I put a Text box at the banner I created so that user could insert an URL that would be readed in an Action.

我在我创建的横幅上放置了一个文本框,以便用户可以插入一个将在Action中加入的URL。

My problem is that I don't know how to access this field from another View or another Action. Can I access it via PlatformUI object or something similar?

我的问题是我不知道如何从另一个视图或另一个Action访问此字段。我可以通过PlatformUI对象或类似的东西访问它吗?

1 个解决方案

#1


0  

You can just store it in a static variable (don't forget to check if it is disposed before accessing it).

您可以将它存储在静态变量中(不要忘记在访问它之前检查它是否被丢弃)。

#1


0  

You can just store it in a static variable (don't forget to check if it is disposed before accessing it).

您可以将它存储在静态变量中(不要忘记在访问它之前检查它是否被丢弃)。