Reusing fragments in different perspectives - eclipse

I have a partstack I want to reuse in a different fragment. It looks like I can import the part stack in one fragment, so I did this.
Then under my Part Sash Container, I add a PlaceHolder element and select this imported Part in the "reference" section.
On both plugins, I have org.eclipse.e4.workbench.model extended.
And yet, nothing shows up.
I also tried to simplify it by just importing one Part. This also does not work.
I know I can create the entire structure and assign new IDs and reference the class files directly, but I don't think that is the correct way to accomplish this. What am I missing?

You put the element you want to share in the 'Shared Elements' section of the 'Trimmed Window' definition.
You then put 'Placeholder' entries in all the Perspectives that want to use the shared element.

Related

Added custom styles(style_formats) to tinyMCE. Classes are appended and not replaced as intended

Followed several tutorials and have added custom classes in the formats section of the tinyMCE. The classes used are being appended and not replaced as I had intended. Is there a way to have them overwrite the existing style if there is one instead of adding to the class tag?
My use case is this: The user select a piece of text and select a class from the formats dropdown I have added. They dont like the color of the link and decide to change it by going back up to the formats tab and selecting a different value. Behind the scenes, TinyMCe replaces the class. I realize I could use the styles key in the json array, but that would produce inline-styles, which I'd like to avoid.
Thanks!
Maybe use exact: true for your style?
https://www.tiny.cloud/docs/configure/content-formatting/#exact
fixed the issue by using inline css rather than using the classes

References in Workspace are collapsed

When I use ctrl+shift+G to find references for an object in eclipse, I will get a list of those, but they are collapsed like this:
Why being collapsed?
Those four occurences are method calls on the object. I expect to be able to see which method calls that are called on the object by looking in this list. Can that be made?
Matches within a single method in a class are always just shown as 'n matches'. There is no way to expand this in the search results view (see Eclipse bug 46051).

Eclipse RCP TableViewer decorators have no visible effect on icons

I'm trying to use ILabelDecorators to decorate icons in the TableViewer.
I use two-column table to show properties of some model object. The first column displays the property name, the second column it the property value.
Some objects in the second column may have icons and I want these icons decorated.
The number of rows in the table is not constant and depends on the kind of the model.
The problem is that the content provider for the TableViewer assumed to provide the 'row model' objects, so I have to use some containers to pack both property name and value.
Then it comes to decorating, Eclipse uses these containers, but not their 'value' parts, to select the appropriate decorators, and to pass as the argument to the decorate() procedure.
As the result, decoration code are never called, because the class of these containers (I use simple Object array) does not match any classes declared in the enablement sections of the decorator elements in the plugin.xml.
Moreover, even if I do not restrict the decorators by classes, these containers are passed to the decorate() procedure in all my decorators, so I have to make all decorators know about these containers existence, which is quite weird.
At last, I have found some solution, I use an IAdapterFactory object to convert containers to their values. But it seem an overkill a bit.
Does anyone know more simple solutions?

Set a fixed controller/action for extension/plugin which are not influenced by whatever is passed on the query string

I want to bootstrap/embed an extension with fixed controller/action and no matter what is passed to the query string (e.g. tx_*[controller]/tx_*[action]) should not change the behavior of the embedded/bootstrapped version of the extension.
Basically I need to insert multiple instances of the same extension/plugin and each instance should only call what I have defined. Currently it throws an exception if it's not allowed or if I allow it it executes whatever is in the query string.
I want to be able to do that with the same plugin with different controllers.
Is it possible?
EDIT:
Lets say I have a plugin with 3 controllers - List, Show, Top. I want to embed in my page the controllers List and Top. When I click on details in List in my query string I have the appropriate arguments so the extension knows I want to show details on one of the items in list. But these arguments also influence what is shown in Top and now Top shows the same thing as List. I want to be able to embed the Top controller who will never change its output based on the query string.
I tried to do it the same way - and failed to do it in a clean way.
According to several tickets on the forge it is recommended to split it up in different plugins.
/edit:
Just as an additional reference, you could check config.tx_extbase.mvc.callDefaultActionIfActionCantBeResolved = 1
Perhaps it can help you in your case.

Drupal - dynamic options for text_list field

I have a custom node type for which I want to have a field that uses a special combobox based on list_text. When one chooses the type list_text it is normally possible to enter a static list of selectable texts, however, I want this list to be dynamic, i.e. based on the results of a db_query. What is the best way to do this using Drupal 7?
A simple example for clarification: A node of this custom type X contains a field that points to another node, so whenever a node of type X is created I want a combobox that contains all other nodes.
(Best solution would be to only display the combobox during node creation, and no longer during edit. But I could also live with it if the combobox was shown during the edit as well.)
I have tried to customize options_select by defining my own data type and implementing hook_options_list accordingly. The combobox was displayed during creation with the correct values, however, I could not save it.. I have no idea what went wrong there, but on the first submit it would change to a different theme, and when I tried again I got an internal server error. Am I on the right track at all with defining a completely new data type for the field? there surely must be a simpler way?
You're right in that you don't need a new datatype. Here's a good tutorial on how to do this. It's not specifically for D7 but I didn't see much that wasn't still applicable. There may be a better way to do it in D7 specifically but I would love to know it too if so :)
The tutorial linked by allegroconmolto sent me on the right way. Thanks for that.
Here's the simpler way of doing it: tutorial
Basically, it is, as I assumed, a common problem and hence a simple solution for it was included in the webform module by now. It provides a hook_webform_select_options_info which can be used to register a callback method. The callback method is then called each time a corresponding option select of a webform is shown, so that you can easily fill it with the results of a dbquery or anything else. Works like a charm and takes next to no time to implement.