Xcode design data - swift

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.

Related

How to show the iOS lookup modal in Flutter for selected text?

In most iOS apps, selected text has a "lookup" option. Flutter interactive selection only shows "cut, copy and paste". I couldn't find an option for "lookup".
Is there a way to show the "lookup" option?
If not, assuming I create my own selection controls, is there a way to manually show the modal?
For reference, here's what I mean by "lookup" option:
and here's what I mean by the "lookup" modal:
You cann't. Flutter overrides all the UI of the native system, drawing its own. Think in Flutter in the same way you think in a videogame. Flutter takes an OpenGL Canvas and draws all stuff by itself from scratch.
As you don't use any elements from native, you neither don't have the native contextual menus. That is why you get that different options.
Now, the kind of good news. You can modify the Flutter one to configure the options. You need to use the SelectableText widget from Flutter. Take a look also at the selectionControls property. You can create your own toolbar from there.

TreeView instead of WebView?

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.

How can I add a custom column menu tab in ag-grid?

Is there a way to add a custom column menu tab with my own favourite icon which on click would render my custom react component?
something like
myColDef.menuTabs: ['generalMenuTab', 'filterMenuTab', 'myCustomMenuTab']
FYI I'm using v12.0.2
What you're after can't be done I'm afraid. The grid supports React components in all sorts of ways (renderers, editors, filters etc), but not via the column menu.
I've updated the docs page to remove the gibberish issue - it'll be fixed properly in the next release, thanks for highlighting this.
This would be helpful to have. In particular for us, we'd like to filter based off row properties, and not row values. Creating our own tab to filter by cell colors that we have assigned with our own set of labels would be useful.
I agree that it would be a nice feature to have. Apparently, there's no quick out-of-the-box solution to do it. The only workaround I see is to implement your own custom Header component which would display any buttons your want.
There you can put a button to open your own custom menu, which you can implement as any regular UI component. It also means you'll need to manually implement all standard menu options that Ag-Grid provides out of the box if you need them.

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.

Design-time properties in IB?

Coming from the .NET world into ObjC and iPhone development, I'm used to providing design-time support for my UI classes. For example, say that I have a custom button class with a color property. I want to be able to set this color in design time from IB. How can I accomplish this? Is it even possible? Worth the effort?
It isn't possible to create custom IB plugins for iOS. The best you can do is use a generic UIView with a custom class in your nib and set the properties programatically.
You would usually create an IBPlugin for that, which can contain a single custom element or an entire collection.
Interface Builder Plug-In Programming Guide (Official Guide)
Custom views in Interface Builder using IBPlugins (Inofficial Tutorial)
(This tutorial should get you going! It covers custom attribute settings in IB.)
Be warned though: Xcode 4 does not support custom built IBPlugins!
(And sadly this still holds true for Gold Master. Hopefully there'll be an official/native solution once the NDA is lifted. Until then make sure to backup your IB before installing any copy of Xcode 4.)
Whilst waiting for the 'User Defined Runtime Attributes' feature to become more widely supported, you can still use the 'tag' property of UIView. This is just an integer, but you can use that as a key into a dictionary to access additional properties. So for example define your design-time attributes in a JSON file, load that into a NSDictionary and walk over the view hierarchy at runtime, applying the attributes you've defined.
It's not ideal but better than nothing, or implementing loads of tiny custom classes just to use a custom font or whatever.
This is actually very easy to do. In InterfaceBuilder, select the button and open the Attribute Inspector (hotkey: [command]+1). Select the first tab on the top of the Attribute Inspector window, and look at the section titled "View". The entry labeled "Background" will have a colored rectangle next to it, which will likely be split diagonally, half black and half white. That's an indication that the button's background is currently transparent. Click that rectangle, and the color selection box will appear. Don't forget to change the value of the "alpha" slider in the color selection box, or the button will remain completely transparent.
Here's an image of the attribute inspector, configured like I described.
For arbitrary types (such as an NSColor property), Interface Builder plugins are your only option, as others have mentioned.
However, for certain limited types, there is an easier solution. If your custom property is a string, numeric primitive, or boolean, you can use the "Runtime Attributes" inspector in Interface Builder to define these properties at design time.
However, I see that you have the 'iphone' tag on your questoin. Runtime Attributes are not currently available on iOS.