TreeView instead of WebView? - visual-studio-code

Once createTreeView() has created a TreeView instance, the reveal() takes your derived implementation of TreeItem. The reveal() does not take a ViewColumn as does the WebView[Panel]. The only way the vscode extension API can specify a ViewColumn is either a ExtHostTestEditor which implements the TextEditor interface, and the WebView. So do all custom editors have to be implemented with WebView? Are TreeView(s) only for activity bar side views?
It seems odd, since there is the admonition to not use WebView(s) since they are so heavy weight. Plus there is additional effort to make the WebView's look-and-feel match the editor. The vscode-json-editor uses a WebView and I haven't found any custom editors that do not use a WebView. Validating the WebView approach would help avoid going down a whole host of rabbit holes. Thank you.

These types of views have different use cases. Here's a quick overview of each VS Code 1.28:
TreeView
TreeViews can be shown in the side bar, such as in the explorer or source control section. Tree views use a data driver api where VS Code controls the presentation. This means that you get a lot for free but that you cannot fully customize the behavior of a tree view.
Use a tree view if you want to add an additional data view. A good example of a tree view would be a custom file explorer, showing the outline of an editor, or presenting a list of resources.
WebView
Webviews can be shown in an editor. They can contain any sort of html content but you are entirely responsible for the user experience of this content.
Use a webview if you need a custom user experience or need to present a completely custom view of data.

Related

Xcode design data

Can I add to my interface builder design data that appears only in design mode?
For example - add text to labels, items to a list view, pictures inside imageviews, etc., all in design mode while using Xcode. However, in runtime, none of it will appear.
If you are coming from the Android world, I'm looking for the equivalent of the "tools" xml attribute.
There is no Hidden during runtime option AFAIK. But you can use Hidden under Attribute inspector->View->Drawing to manually hide each UI elements.

Dynamically add tabs in Tablayoutpanle using UIBinder

To be clear i'm a newbie to GWT.I was looking around for samples to implement dynamic tabs, and found this link, http://www.java2s.com/Code/Java/GWT/AddingnewtabdynamicallyExtGWT.htm , in which they make use of GXT.But my question is,how can i implement dynamic views using UIBinder?.I want to implement something similar to browser tabs.Each newly created tab has a split panel view, whose content will be populated making a rpc request.My question is , how is the history mechanism handled when user switches between tabs?.Can anyone provide with samples?Thanks
You declare your TabLayoutPanel together with the initial/default tabs in UiBinder. Then you can add or remove tabs from this panel in your Java code.

Binding to custom built control according to different data

Here's the issue, I build a special book reader/browser (For holy quran), my code behind loads the page and constructs how it should look. and then it should bind that look to a some kind of data-bindable custom control to view it properly. the problem is, the look differs from page to page, so I cannot bind to a certain control or wrap panel.
here's how it generally looks:
The decorative border top of the page is always there at any page, it indicates the part and chapter the viewer is in.
If you're starting a new chapter it have additional image under that decorative border or anywhere in the page (there can be multiple chapters in the same page) something like this
or this:
The normal text is not an issue, it's just a special font, however, I put each individual word in its own text block for reasons of user selection by word.
The issue here is, given the previous information, and knowing how random it is to place the decoration picture or the amount of words (text blocks) per page. how can I bind that to some kind of view to separate the view from the VM and Engine that builds the page.
my past solution was to actually build everything in the VM in a wrappanel built inside a scrollviewer having lots of textblocks and images according to the page. but that's naiive solution. I want to rebuild that in a more professional separated way. I also want to do this for Windows RT beside Windows phone so I need to reuse the code behind in a Portable class library.
I think all you need to do is slightly adjust your current design. So perhaps have a VM that represents the entire content, and that would have a Collection of say Pages or Sections. A second VM would represent the Page/Section, allowing you to create a property for the WrapPanel content (i.e. the words) and another property for the Header and or other things.
In the View you would have the scrollviewer and bind to the main VM collection. Then create another View or DataTemplate that represents the Page/Section.
You should be able to do this is a strict MVVM sense quite easily and it will be dynamic based on the content.
You could even cater for advanced scenarios where each section has a different template/view.

j2me form how to define gui properties

i'm new to j2me. how to set form elements (text field ,text box) width,font,alignment and other Gui related properties.
i tried to find solution for setting form background but no success. can you guide me
Firstly, J2ME is a very limited framework.
As far as I can remember if you are just using an item from the basic javax.microedition.lcdui package there is very limited styling available. It allows you to give directives on how to lay the item out on the screen and what the item's appearance mode will be.
An Item is not responsible for where it is placed and is down to the Screens layout management algorithm to place your item on the Screen. For example, the way Items are laid out on Forms and Lists differ based upon how the layout management works.
You can create your own customs items by extending CustomItem and implementing and overriding various functions to get the desired visual effect. This however is a lot of work
and the end result is not always very pleasing. You could also do the same by extending the Form class and overriding the paint methods to get your disered visual effect.
The best way to have control over form elements is to use one of the Widget like frameworks that exist and are built upon these basic J2ME classes. For example LWUIT and J2ME Polish allow you to style items in a very similar manner and layout Items using a CSS box inspired manner.
Although I have no used LWUIT so cannot vouch for it.

Left-aligned tabs in GWT

I have a project in which I need a way to display essentially a list of tabs, each with their own content pages, down the left side of the page. I'm using TabLayoutPanels elsewhere to good effect, but after looking at how they are constructed it seems like it would be quite a bit of work to undo Google's carefully constructed layout and get it to work in any other orientation than top-aligned.
This doesn't seem like it would be an uncommon layout, so does anyone know of a successful implementation of this kind of container?
Best you can do is use DeckPanel, and make your custom tab controls to switch visible widget in that DeckPanel.