How to use TableViewer in WindowBuilderPro? - eclipse

I have to create a table in my wizard page and I want to create it using TableViewer. I'm using WindowBuilderPro for designing my wizard page. The TableViewer control is available in the palette of WindowBuilderPro but I'm not getting how to use it properly.
Has any body used the same?
Thanks a lot in advance!!

You have two ways of filling the TableViewer with contents (similar to TableViewers in JFace):
You can define a content provider and a label provider manually. A content provider has to return a set of Objects, that represent each line of the table; while the TableLabelProvider translates the returned objects to texts in the columns. The content and label providers are to set in the Properties box on the left. In this case, the resulting code should look like the following snippets: http://wiki.eclipse.org/JFaceSnippets#Snippet001TableViewer or http://wiki.eclipse.org/JFaceSnippets#Snippet007FullSelection.
On the other hand you could define JFace Data Bindings to fill the table with contents. In this case you have to define a corresponding binding, that returns the list of all contents; additionally you have to create a label provider, that works similar to the previous one.
There is also a way to fill the table content using a newer API then supported directly by WindowBuilder: you could create TableViewerColumns, and ColumnLabelProviders for each column, thus resulting in much nicer code for Label Providers (and also this API is newer, so it should be preferred for new JFace based code) - but in this case you have to create your code manually. See the JFace Table tutorial from Lars Vogel.
Additionally, if you don't know the JFace Viewer framework from before, I suggest reading the first few questions listed in the JFace FAQ to gain a better understanding of the ideas (and the tutorial from Lars Vogel is also nice for this reason).

Related

Columns Layout export

Sparx Enterprise Architect offers the possibility to define custom layouts for list views in the package browser and to save these definitions. When exporting a Project file (*.eap) via xmi, these definitions are not included in the export-file and thus lost. I wonder whether there exists a way to transfer columns layout definitions between two EA-Projects.
Many thanks in advance for every hint!
As Geert suggested the layout is stored in the registry.
[HKEY_CURRENT_USER\Software\Sparx Systems\EA400\EA\OPTIONS]
holds a key PKG_BRWSE_LAYOUTS with the comma separated list of profile names (so you better don't use comma in your profile name ;-).
The detailed information is stored in
[HKEY_CURRENT_USER\Software\Sparx Systems\EA400\EA\EA1200Workspace\BCGPGrids\EA_ELEMENT_LIST_<name>BCGPGrid-0]
where <name> is the according profile name.
For a sample layout here they looked like
"Columns"=hex:11,00,01,00,00,00,01,00,00,00,01,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,01,00,00,00,01,00,00,00,01,00,00,00,01,00,00,00
"ColumnWidth"=hex:11,00,16,00,00,00,04,01,00,00,50,00,00,00,50,00,00,00,50,00,\
00,00,50,00,00,00,50,00,00,00,50,00,00,00,50,00,00,00,50,00,00,00,50,00,00,\
00,50,00,00,00,50,00,00,00,50,00,00,00,50,00,00,00,50,00,00,00,50,00,00,00
"ColumnOrder"=hex:08,00,00,00,00,00,01,00,00,00,06,00,00,00,02,00,00,00,0d,00,\
00,00,0e,00,00,00,0f,00,00,00,10,00,00,00
"Groupping"=hex:00,00
"LastFieldChooserPos"=hex:00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
"IsFieldChooserVisible"=dword:00000000
"IsFieldChooserThemed"=dword:00000001
"SortColumns"=hex:00,00
I have to leave that to you to decipher the coding used here. But for a pure ex-/import you probably don't need to do that.

User selectable widgets in Umbraco 7

We are looking at Umbraco as a possible alternative to our current CMS which was developed in house and which although powerful, is dated now and becoming more difficult to maintain.
One really good feature which we would be loth to lose is the widget feature. Using this, we can build a widget by defining a number of inputs (eg text fields, media picker, links etc) together with the html required to output the results (using placeholders to substitute in the content entered by the web content editors).
On the page, content editors can select which (if any) widget(s) to use, enter content into the inputs defined in the widget, and the page outputs this accordingly.
In other words, without resorting to programming, we can create widgets just by defining inputs and the output html in minutes.
Users can select widgets and their input is controlled and formatted.
Simple and effective.
Is anything like this available in Umbraco without having to develop new C# code for each widget? I have looked into using macros in a rich text field, but I can't see how they can be made editable using complex data entry as described above.
Beside the Macro in richtext,
In Umbraco you can use a picker/list view data type to select some "component/widget items" and for rendering it requires some code if more than one document type is allowed, if document type is x1 do code a1.
Use (Partial view) Macro Files for reuse.
This is the closest to the "widget" function you want.
A other relatively new datatype in Umbraco is the Grid layouts, allow editors to create a Complex data, column structure with multiple data types. I suspect not comparable/useful for your "widget" function.

Listing annotations in a TreeViewer

I have an eclipse plug-in with a search-like function.
The search-like function identifies statements, which fullfill
some conditions and I want to annotate these statements
and show this annotations in a TreeViewer, just like the
SearchView of eclipse.
(How) can I add this annotations to the Model, in order
to show them in the TreeViewer? I want the annotations
to apear in the TreeViewer under the corresponding JavaElement
You do this in your ContentProvider associated with the TreeViewer, you can set the content to anything you like. You can provide the appropriate styled text (instead of plain text) though the content provider.

How to fusion two content elements? / Does an all in one content element exist?

I need a content element that cointains apsects from the "Textpic" and the "Media" content elements.
Basically I need the whole palette of input masks of the textpic CE (headline, rte text, images) plus the media tab (swf, mp4, mov) from the media content element.
This special requirements for our project comes from the need that we can only use one content element for our specific javascript content slieder. So I can not use like a Textpic and underneath a media CE. No it really has to be just one CE which can handle the textpic + the media CE stuff.
Generally I ask you: Is there already a extension, trick, modification or a framework which I can/should be use to achive that i can "fusionate" content elements? Like an "all-in-one"-content element, a multi content element?
Ps: I do not use Templavoila. My Typo3 version is 4.5
I think this is the tutorial you're looking for:
http://castironcoding.com/resources/our-blog/sp/view/single/post/reason-6-for-choosing-typo3-custom-content-elements-and-extbase-again-part-23.html
Follow step 2 and 3.
You'll also need to add a specific rendering config in Typoscript ie: tt_content._your-ce_
But it can be copied from out of tt_content.textpic and tt_content.media. You can find the expample typoscript of before mentioned CE's in: typo3/sysext/css_styled_content/static/setup.txt. Just don't alter it there, but make a copy and alter in your own file.
As you seem to only talk about reusing already exisiting fields, you really only need to change the backend interface (big keyword: "showitem"). You'll need the database names of the fields (peek into the tt_content table of some records where you know the contents), alternatively visit the module Admin Tools / Configuration, select TCA in top dropdown menu, open tt_content and columns.
Try http://blog.chandanweb.com/typo3/adding-new-fields-to-existing-typo3-tables-at-desired-location, you'll of course have to substitue tt_content for tt_news etc.
You might also want to make a new type (the above recipe is for changing a preexisitent), but I'm sorry, I'm currently out of time for explaining that. It's not very hard, though, and the castiron link by Koopa will help you on your way.
Perhaps you can wrap the content column in another div? You can use that outer div for your content slider. Now you actually use all content elements seperately, but combine then for usage.

How to change the SSRS input parameters position in report

My SSRS report contains 7 input parameters and while running my report the size of the parameter(i.e. length) is increasing.
One of my input parameter(drop down list) may contain 100 characters so the size is not constant but i want to place all parameters in 2 lines or 3 lines(in a row).
Now it is coming 2 parameters per a row
Please advice
As gbn indicates, it's not easy to change the built in report server method of presenting the parameters. SSRS likes to always use two parameters per line, presented in the order that they exist in the report (which must match the dependency order.)
So the alternatives that gbn mentions: Both involve building a "Wrapper" application: some custom code or a web page that you can code however you like to get the parameters. Then you call Reporting Services, either in code or by passing a formatted URL with your parameters. The report can be displayed in a frame, new window, or passed as a stream to where ever you'd like.
The URL access is pretty straightforward and reliable: I often use it either by hand (to create "favorites") or in code.
http://msdn.microsoft.com/en-us/library/ms153586.aspx
For what you are looking for, these might be more work than you expected, but they will be extremely flexible for your interface.
Jamie
You can certainly do that, just right click on the RDL file in the solution explorer and select view code. then move the XML tags named <ReportParameter Name="Nameofparameter"> under <ReportParameters> according to where ever you want to position. And then save it. thats it!!!
The report parameters are kind of floating in values of 2, so if u have 4 report parameters then it will be shown as 1,2 next line 3,4. Best of luck!!
Use ASP.NET for the paramaters and a ReportViewer control or URL access to render. Seriously.
I don't know of any option to present parameters any way other then the default
I believe you could try using jQuery. The report parameters are rendered in a table under a div tag with class sqlrv-ParameterContainer. Write a jQuery or JavaScript function that will extract the full innerHTML from this div ie. the table content and then extract the table row information like the <label> or <input> tags.
Create your desired table structure with <table><tr><td>{extracted sections}</td><td></td></tr></table> or leave it to your requirement...
Then just append this new HTML structure in place of the original default structure.
In jQuery it will be like
$(".sqlrv-ParameterContainer").html();
which will give you the entire table structure that comes inside the parameter. Use XML parsing and get the input controls and all. Extract these controls as-is, don't change anything.
$(".sqlrv-ParameterContainer table").remove(); // it will remove the SSRS rendered default table from DOM
$(".sqlrv-ParameterContainer table").appendChild('<table><tr>......</tr></table>'); // Append your custom html structure here....
This was something that came to my mind quickly... I would suggest you test it... :)
This doesn't help the OP with SSRS-2008 but in case it helps others - Microsoft have improved this in SSRS 2016 - parameters can now be easily managed via the GUI in Report Builder / Visual studio:
https://www.intertech.com/ssrs-parameters-2016-update/