首页 \ 问答 \ 为什么我在eclipse插件中看不到SWT / JFace TitleAreaDialog中的更改?(Why can't I see Changes in SWT / JFace TitleAreaDialog in my eclipse plugin?)

为什么我在eclipse插件中看不到SWT / JFace TitleAreaDialog中的更改?(Why can't I see Changes in SWT / JFace TitleAreaDialog in my eclipse plugin?)

我正在开发一个eclipse插件(不是RCP),我正在使用Jface和SWT来创建它的用户界面。 事实是,我已经下载了WindowBuilder插件,以便开发用户界面,并创建了一个自定义的TitleAreaDialog。

到目前为止,一切都很顺利,我可以在WindowBuilder中看到以下TitleAreaDialog(上图),当我尝试运行eclipse插件时,问题就出现了。 树的左侧元素消失了:

WindowBuilder(顶部)和插件执行(底部)

有人知道发生了什么吗? 我必须添加一些东西到plugin.xml或MANIFEST.MF吗?

谢谢。

编辑:在zip中你会发现plugin.xml,MANIFEST.XML,build.properties,Handler和gui,称为PlugiGUI。 如果您有任何问题请问我。

谢谢。

你可以在这里下载代码。

编辑2:部分MANIFEST.MF代码如下

Bundle-SymbolicName: org.eclipse.plugin.arturito;singleton:=true
Require-Bundle: org.eclipse.ui,
 org.eclipse.core.runtime
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .,
 swing2swt.jar

TitleAreaDialog代码的一部分如下:

/**
* Create contents of the dialog.
* @param parent
*/
@Override
protected Control createDialogArea(Composite parent) {
    //TITLE AND IMAGE OF TitleDialog
                ...

    //Composite        
    Composite area = (Composite) super.createDialogArea(parent);
    Composite container = new Composite(area, SWT.NONE);
    container.setLayout(new FillLayout(SWT.HORIZONTAL));
    container.setLayoutData(new GridData(GridData.FILL_BOTH));

    //Creates the division
    SashForm sashForm = new SashForm(container, SWT.NONE);


    //Right division
    Group rightGroup = new Group(sashForm, SWT.NONE);
    rightGroup.setLayout(new StackLayout());

    //Create the tree
    Tree tree = new Tree(rightGroup, SWT.BORDER);
    tree.setLinesVisible(true);
    tree.setToolTipText("");
    tree.setHeaderVisible(true);

    //Create tree elements
    TreeItem pluginProperties = new TreeItem(tree, SWT.NONE);
    pluginProperties.setText("Plugin properties");
    pluginProperties.setImage(ResourceManager.getPluginImage("org.eclipse.plugin.arturito", "icons/arturitoProperties.png"));


    TreeItem createPluginProperties = new TreeItem(pluginProperties, SWT.NONE);
    createPluginProperties.setText("Create");
    createPluginProperties.setImage(ResourceManager.getPluginImage("org.eclipse.plugin.arturito", "icons/arturitoPlus.png"));
    TreeItem editPluginProperties = new TreeItem(pluginProperties, SWT.NONE);
    editPluginProperties.setText("Edit/Delete");
    editPluginProperties.setImage(ResourceManager.getPluginImage("org.eclipse.plugin.arturito", "icons/arturitoRemoveEdit.png"));
    pluginProperties.setExpanded(true);

    //MORE TREE ELEMENTS WITH SAME PATTERN
    ..............

    //Left division
    Group leftGroup = new Group(sashForm, SWT.NONE);
    leftGroup.setLayout(new StackLayout());

    Composite projectConfigDescriptor = new Composite(leftGroup, SWT.NONE);

   //Proportion of sashForm
    sashForm.setWeights(new int[] {220, 469});
    return area;
}

为什么WindowBuilder会像我想要的那样显示TitleDialog而我的插件不是?


I am developing an eclipse plugin (not RCP) and I am using Jface and SWT to create it´s user interface. The fact is that I have downloaded the WindowBuilder plugin to make it easier to develop the user interface and I have created a custom TitleAreaDialog.

Up to this point everything goes ok and I can see the following TitleAreaDialog in the WindowBuilder (top image) and the problem comes when I try to run the eclipse plugin. The tree and it´s elements of the left side disappear:

WindowBuilder (top) and Plugin executed (bottom)

Does anybody know what is happening? Do I have to add something to plugin.xml or MANIFEST.MF?

Thank you.

EDIT: In the zip you will find the plugin.xml, MANIFEST.XML, build.properties, Handler and the gui called PlugiGUI. If you have any questions ask me please.

Thank you.

You can download the code here.

EDIT 2: Part of the MANIFEST.MF code is the following

Bundle-SymbolicName: org.eclipse.plugin.arturito;singleton:=true
Require-Bundle: org.eclipse.ui,
 org.eclipse.core.runtime
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .,
 swing2swt.jar

Part of the TitleAreaDialog code is the following:

/**
* Create contents of the dialog.
* @param parent
*/
@Override
protected Control createDialogArea(Composite parent) {
    //TITLE AND IMAGE OF TitleDialog
                ...

    //Composite        
    Composite area = (Composite) super.createDialogArea(parent);
    Composite container = new Composite(area, SWT.NONE);
    container.setLayout(new FillLayout(SWT.HORIZONTAL));
    container.setLayoutData(new GridData(GridData.FILL_BOTH));

    //Creates the division
    SashForm sashForm = new SashForm(container, SWT.NONE);


    //Right division
    Group rightGroup = new Group(sashForm, SWT.NONE);
    rightGroup.setLayout(new StackLayout());

    //Create the tree
    Tree tree = new Tree(rightGroup, SWT.BORDER);
    tree.setLinesVisible(true);
    tree.setToolTipText("");
    tree.setHeaderVisible(true);

    //Create tree elements
    TreeItem pluginProperties = new TreeItem(tree, SWT.NONE);
    pluginProperties.setText("Plugin properties");
    pluginProperties.setImage(ResourceManager.getPluginImage("org.eclipse.plugin.arturito", "icons/arturitoProperties.png"));


    TreeItem createPluginProperties = new TreeItem(pluginProperties, SWT.NONE);
    createPluginProperties.setText("Create");
    createPluginProperties.setImage(ResourceManager.getPluginImage("org.eclipse.plugin.arturito", "icons/arturitoPlus.png"));
    TreeItem editPluginProperties = new TreeItem(pluginProperties, SWT.NONE);
    editPluginProperties.setText("Edit/Delete");
    editPluginProperties.setImage(ResourceManager.getPluginImage("org.eclipse.plugin.arturito", "icons/arturitoRemoveEdit.png"));
    pluginProperties.setExpanded(true);

    //MORE TREE ELEMENTS WITH SAME PATTERN
    ..............

    //Left division
    Group leftGroup = new Group(sashForm, SWT.NONE);
    leftGroup.setLayout(new StackLayout());

    Composite projectConfigDescriptor = new Composite(leftGroup, SWT.NONE);

   //Proportion of sashForm
    sashForm.setWeights(new int[] {220, 469});
    return area;
}

Why does the WindowBuilder show the TitleDialog like I want and my plugin doesn´t?


原文:https://stackoverflow.com/questions/39770275
更新时间:2023-02-18 21:02

最满意答案

我认为问题在这里

p.PlayerGameRole = player.PlayerGameRole

尝试显式创建集合并添加元素:

p.PlayerGameRole = new List<PlayerGameRole>();
foreach(var role in player.PlayerGameRole)
{
p.PlayerGameRole.Add(role);
}

I think problem is here

p.PlayerGameRole = player.PlayerGameRole

try to create collection explicitly and add elements:

p.PlayerGameRole = new List<PlayerGameRole>();
foreach(var role in player.PlayerGameRole)
{
p.PlayerGameRole.Add(role);
}

相关问答

更多
  • 这里最终的问题不是使用哪种对象关系映射器(ORM) ,而是最终使用哪种映射器。 这个特定的层通常交织在数据访问层(DAL)中 。 您看到这里的函数本质上是一种在不兼容类型之间进行转换的技术。 本质上它创建了一个可以使用的虚拟对象数据库 。 此层的重要性在于将您的域逻辑/业务层链接到您的数据访问层或对象关系映射器 。 这基本上可以帮助解耦不需要访问数据结构的逻辑 - 这使得用户界面,域逻辑和数据访问层之间的解耦更加连贯。 接口不知道数据层如何与数据结构对话。 目前,由于相似性,我一直在混合数据访问层和对象关系 ...
  • 查看SQL Management Objects(SMO),它是由microsoft开发的一个库,用于通过托管代码在SQL Server数据库上执行管理任务。 它包括脚本数据库及其中的对象的代码,这些代码应满足您的大部分应用程序需求 Take a look into SQL Management Objects (SMO), its a library developed by microsoft for performing management tasks on SQL server databases ...
  • 如果CSV仅用于缓存结果,则可以使用Dictionary来存储搜索结果的内容。 将代码分成函数可能会有所帮助: private static object GetFirstValue(ResultPropertyCollection properties, string propertyName) { var propertyValues = properties[propertyName]; var resul ...
  • 您可以使用它将货币符号的字符串转换为十进制: var num = decimal.Parse("$25,529.98", NumberStyles.Currency); 如果您需要/想要,您也可以传递文化: var cultureInfo = new System.Globalization.CultureInfo("en-US"); var num = decimal.Parse("$25,529.98", NumberStyles.Currency, cultureInfo); You can us ...
  • 您不应为每个“导出任务”使用单独的会话/连接。 每次登录数据库都会导致非必要的操作(如写入数据库日志),这会降低整个应用程序的速度。 如果您期望连接问题 - 请使用try-catch并处理数据库异常,并在连接断开时重新连接。 You shall not use separate sessions/connections for each "export task". Each login to database will cause non-necessary operations (like writes ...
  • 我认为问题在这里 p.PlayerGameRole = player.PlayerGameRole 尝试显式创建集合并添加元素: p.PlayerGameRole = new List(); foreach(var role in player.PlayerGameRole) { p.PlayerGameRole.Add(role); } I think problem is here p.PlayerGameRole = player.PlayerGameRole t ...
  • 尝试http://www.db4o.com/ 这是oo数据库列表以及比较图表 。 Try http://www.db4o.com/ Here's a list of oo databases and also a comparison chart.
  • 看看DateTime.Parse()方法。 编辑:我想您使用SqlCommand ,然后您只需将生成的c# DateTime对象添加到Parameters集合中。 Have a look at the DateTime.Parse() method. Edit: I suppose you use the SqlCommand, then you just add the resulting c# DateTime object to the Parameters collection.
  • 听起来你在谈论ORM 。 您可能想要查看Castle ActiveRecord (它是基于nHibernate构建的)。 如果您使用的是.NET 3.5或4.0,则也可以使用.NET实体框架 。 就个人而言,我更喜欢ActiveRecord,因为我喜欢能够使用代码中的属性来定义映射。 实体框架使用映射XML文件(可以使用Visual Studio的GUI设计器进行修改),我发现它有点笨重(EF专家可能会在这里首先讨论代码。)此外,实体框架非常LINQ重,这是很棒,如果你喜欢LINQ。 ActiveRecor ...
  • 如果您在连接字符串中使用AttachDbFileName=子句,那么您可能已成为一个众所周知的问题的受害者:在检查数据时,您可能只是在查看错误的数据库(文件) 。 在Visual Studio中运行应用程序时,它将复制.mdf文件(从您的App_Data目录到输出目录 - 通常是.\bin\debug - 您运行应用程序的位置),而且很可能您的INSERT工作正常 - 但你最后只是看错了.mdf文件 ! 如果你想坚持这种方法,那么尝试在connection.Close()调用上设置一个断点 - 然后用SQL ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)