DataGrip wrap text inside cell - datagrip

How to wrap the text inside cell in DataGrip?
I am increasing my row height and want the text/data in value column to wrap instead of me scrolling to the right to view all the cell content.
Is it possible to do in Datagrip?

Choose 'Active Editor: Use Soft Wraps' from the Find Action (Ctrl+Shift+A) menu if you'd like to have word wraps for viewing the text.

Related

Edit text in NSOutlineView like Finder

If you rename a file in the Finder, the text field expands horizontally up to about the width of the column. And then it expands vertically up to three rows before scrolling. I'm assuming this has to be done in a text field outside the outline view. And I can get a text field to resize while I type. I just don't know how to place it over the outline view when necessary. And keep it pinned to the row if the outline view scrolls. Does anyone have any insights? Thanks!
Text editing is handled by a dedicated NSText and it’s called “field editor”. This shared single view is used for all text editing that happens in the window. It’s separate from what usually displays the text (when not editing).
Here are the docs:
https://developer.apple.com/documentation/appkit/nswindow/1419647-fieldeditor
As mentioned in the docs discussion section, you can use and customize another field editor. This should be a starting point for your task.
The window’s delegate can substitute a custom field editor in place of the window’s field editor by implementing windowWillReturnFieldEditor(_:to:). The custom field editor can become the default editor (common to all text-displaying objects) or specific to a particular text-displaying object (object).
NSControl docs also have a section about Field Editor that might help.

How to make NSSearchField take up whole width of toolbar

I am trying to make a NSSearchField taking up the whole width of a toolbar in a NSWindowController.
I created a new NSWindowController using Xcode storyboard, add a toolbar to it, when add search field to the toolbar.
I drag the search field from allowed toolbar items to default toolbar items
Set toolbar item's max width to a large number say 1000
I build the app and run. The search field shrinks when window width shrinks, but does not expand beyond a certain width when window width expands.
The question is how to make search field expand and take up all remaining space of the toolbar?
It doesn't sound to me like the toolbar is really what you want to use here. The purpose of the toolbar is to allow multiple UI elements to be included in a user-configurable way. If you want to force one element that takes up the entire width, I suggest just putting it in the window's content view and setting up the layout constraints to pin to both the left and right sides. If you set the "Textured" check box in Interface Builder, it should look roughly the same as it would have looked using the toolbar.

I Can't figure out ho to add a return to text in UITextView attributes inspector

xCode 5.0.2
Ive got some text i want to appear in a UITextView so the user can add to it like a template.
It needs to be a list that they can add their info to it :
Like:
This:
Put:
Number:
Beside:
I tried doing this in the Attributes inspector and manually in the storyboard.
But every time I hit return in the attributes inspector it takes it as Enter.
IS there a special character I need to use in order to get a hard return in the body of the text?
Very confused with this.
So the solution:
To change lines in IB:
Alt+Return
When using the storyboard's Text View attribute inspector on a Mac I used option + return in order to create a new line. Be aware of your font size as the spacing will be affected.
Story board Attribute Inspector

NSTableView with Plus and Minus buttons

How can I do something like that?
I didn't find any appropriate object in the Interface Builder library.
Any thoughts?
The best way that i found is to use NSSegmentedControl.
after you dragged it on the canvas, you should configure its style:
Style: Small Square
Mode: Select Momentary
looks better. Now use "image" field to set NSAddTemplate and NSRemoveTemplate. Make sure that label field is empty.
Ok, we have "+", "-" and one empty segment. To prevent the latest one to be selected by the user, select it from Segment: pop up and turn off Enabled check box (located next to State: label).
And lastly, what we have to do is set width of first two segments to make them square.
Go to Size inspector
Select Segment 0
Turn off "Fixed" checkbox (segment should immediately autoresize to fit image)
Select Segment 1 and repeat number 3
Now as you resize control, only last segment will change width
Put it at the bottom of your table view and resize as well.
Enjoy ;)
Update for OSX Yosemite
I tried to achieve the same look as Mail.app has in the Accounts view (right window on my screenshot).
I did achieve the desired result by following the steps below:
Add a NSSegmentedControl
Add two segments and set the image to each:
NSAddTemplate for the + button
NSRemoveTemplate for the - button
Set the size of the segments to fixed and set the value to 32 pixels
The rectangle next to the buttons is a NSButton with the style Gradient.
The Button is enabled but Refuses First Responder is set to true so that it is not clickable.
Use a NSButton with a gradient style, and for the images use the system provided NSAddTemplate and NSRemoveTemplate.
One answer here suggests using gradient buttons, however these buttons cannot be disabled as this causes the background to change and thus breaks the look. Another one suggested using a segmented control, which is almost perfect but segmented controls don't support autoresizing, e.g. if the table width is dynamic. My suggestion is a combination of both. Use a segmented control for the actual buttons and a gradient button to fill the rest of the table width that now can also be dynamic if the button width is dynamic as well.
See my answer to a similar question (with screenshots):
https://stackoverflow.com/a/22586314/15809

How can I blend in my SegmentedControl in a UITableView better?

As you can see on the screenshot the segmented control is placed rather ugly this way.
I need it in that place, meaning below the section title and before the second cell for that section. How could I make this better?
I can think of two suggestions that would improve the appearance. The first would be to increase the height of the table cell (just that particular table cell, not all of the cells in your table) so that the whitespace margin at the top and bottom of your segmented control is equal to the margin you currently have on the left and right of the control.
Another solution would be to move the selection of the value for this setting into a separate tableView controller that you drill down to. So that cell would show the current value, but tapping the cell would take the user to a new view where the user could select to change the value.
Here is an example of this from the Instapaper app settings page that I think looks pretty clean.

Resources