A IFolderLayout have many viewpart how to show Full name of viewpart - eclipse-rcp

There are a lot of viewPart in IFolderLayout,so the name of viewPart can only see the a character.
How to show full name of viewPart, even though there are a lot of verwPart.

There is a preference for the minimum widths of view tabs:
IWorkbenchPreferenceConstants.VIEW_MINIMUM_CHARACTERS
You can set the value in a preference initializer or in a plugin_customization.ini file like this:
org.eclipse.ui/VIEW_MINIMUM_CHARACTERS = -1
(-1 disables any shortening of the tabs)

Related

javafx8 scenebuilder menu shows controls labeled for container object

When I place JavaFX object inside a container, for example some checkboxes inside an hbox:
The scenebuilder controls for each checkbox show the container object in the menu (and different settings are shown here depending on the actual container):
But changing the "margin" value here, for example, clearly affects the individual checkbox and not the HBox. For example, setting only the middle checkbox to have a left margin of 20 yields a change to only the middle checkbox:
So why is that menu area labeled with the container name? I fear I am missing some fundamental design aspect by not understanding this.
They are properties of the control that are specifically available when its parent is an HBox. They correspond to the static methods HBox.setXXX(node, value), e.g. HBox.setHgrow(...).
If you put the check box in an AnchorPane instead, for example, you would see "Anchor Pane Constraints" instead of "HBox Constraints" and you would have options including "TopAnchor", "LeftAnchor" etc., corresponding to the static AnchorPane.setXXX(node, value) methods.

How can I change vertical spacing in Gtk2 menu items in Eclipse?

I'm trying to make Eclipse UI more compact and already have successfully tweaked it using these instructions:
Can I make Eclipse on Ubuntu look more compact?
https://gist.github.com/andrioli/3825078
The only remaining thing I want to improve is reducing vertical spacing between menu items as on this picture:
.
I looked through GtkMenuItem style properties, but can't find any setting for that. GtkMenu::vertical-padding also doesn't seem to be right one.
Is there any Gtk2 widget property that I can modify to do it?
There are a couple of settings in your theme's gtkrc file that you can modify to make the menu items more compact:
To reduce the width and height of the menu items, you can assign a smaller value to the xthickness and ythickness properties respectively (horizontal and vertical padding respectively between the text and border of a widget). e.g.
style "menu_item" {
xthickness = 1
ythickness = 1
}
The above code snippet assumes your GtkMenuItem widget uses a style called menu_item in your theme's gtkrc file. i.e.
widget_class "*<GtkMenuItem>*" style "menu_item"
The height of the separator menu item (line separating menu items) can be reduced by assigning a smaller value to the GtkWidget::separator-height property. e.g.
style "separator_menu_item" {
xthickness = 1
ythickness = 1
GtkSeparatorMenuItem::horizontal-padding = 0
GtkWidget::wide-separators = 1
GtkWidget::separator-width = 1
GtkWidget::separator-height = 1
}
Again, the above code snippet assumes your GtkSeparatorMenuItem widget uses a style called separator_menu_item in your theme's gtkrc file. i.e.
widget_class "*<GtkSeparatorMenuItem>*" style "separator_menu_item"

How to fixed window size in eclipse rcp e4

I didn't want it to be dragged to change the size. I'm the primary learner.
I create a part in the Application.e4xmi.
The structure is 'Window and dialogs ---> Trimmed Window ----> Controls ----> Part', then I created a class to associate it.
If you just have one part in the trimmed window you can set the style of the window to prevent resizing.
You do this by setting a styleOverride value in the 'persisted state' section on the 'Supplementary' tab of the 'Trimmed Window' page in the Application.e4xmi.
Add a persisted state value with a key of 'styleOverride' and a value of '96' which corresponds to the 'SWT.CLOSE | SWT.TITLE' style.

Eclipse ui: retrieving the first visible line of an editor

In the Eclipse UI, I'd like to set the visible area in an editor. In other words, if the number of lines of my file is larger than the number of lines my editor can show then I want to specify the first shown line. My first approach was to calculate the first visible line via the selection value of its vertical scroll bar. The following link points to my initial question. Its answer explains how to set the first visible line in an editor.
eclipse ui: setting scrollbar but editor does not follow
The problem now is that my initial way of retrieving the first visible line in an editor fails in some cases: Although I verify that the active page is indeed an editor, the focus might be assigned to another page. In such a case, the following code yields the ScrollBar of a different page:
public static void update(final IWorkbenchWindow w)
final Scrollable scrollable =
(Scrollable) w.getWorkbench().getDisplay().getFocusControl();
final ScrollBar vScrollBar = scrollable.getVerticalBar();
So, my question: If editor is the reference of an active editor (ITextEditor and IReusableEditor), how to I get its first visible line?
If you can access the editor ITextViewer or its extension ISourceViewer (usually implemented by the SourceViewer or TextViewer class) you can call the ITextViewer.getTopIndex() method to get the top line index.
If your editor is derived from AbstractTextEditor (or one of its subclasses such as TextEditor) there is a protected method getSourceViewer() that returns this. You may have to add a public method if you want to access this from outside of the editor.

How do you change the mouse over highlighting?

In GWT, I am using CellTable.
When you mouse over the CellTable it highlights each row.
How do change the behavior of the highlighting from the mouse over? Specifically:
change the color of highlighting
disable/enable
make it highlight only the specific grid item at your cursor (instead of the entire row)
( The current hack I have is to create a bunch of 1 column wide CellTables and add them to a VerticalPanel layout... creating the illusion that there is one CellTable and it highlights each grid according to your cursor. Is this bad? Why? performance? )
You will notice the CellTable uses a ResourceBundle, which means all the css styles get obfuscated ... this makes it more difficult to override styles.
The CellTable constructor will actually allow you to override the default ResourceBundle. So first, you need to create your own resource bundle like this:
public interface CellTableResources extends Resources {
public CellTableResources INSTANCE =
GWT.create(CellTableResources.class);
/**
* The styles used in this widget.
*/
#Source("CellTable.css")
CellTable.Style cellTableStyle();
}
Then you need to create your own CSS file. I recommend copying the CellTable style directly into your project and use that as a starting point. You can find it here:
http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/src/com/google/gwt/user/cellview/client/CellTable.css
Make sure the style is injected first, and then you just feed it into the CellTable's constructor like this:
CellTableResources.INSTANCE.cellTableStyle().ensureInjected();
myCellTable = new CellTable<T>(Integer.MAX_VALUE,CellTableResources.INSTANCE);
Specifically, you'll want to tweak these styles:
cellTableKeyboardSelectedRow
cellTableKeyboardSelectedRowCell
cellTableSelectedRow
cellTableSelectedRowCell
cellTableKeyboardSelectedCell
It is important to note that the cell table differentiates between the 'selected row' and the 'keyboard selected row'. The selected row is the actual row selected (ie via SelectionModel). The keyboard selected row refers to what is highlighted when the user is pressing the up / down key, but does not mean the row is actually selected (if that makes sense).
I'll just add for number 2) on your list, you can simply do
cellList.setSkipRowHoverStyleUpdate(true)
That completely disables highlighting. There are also two more setSkip-functions on CellList related to hovering.
CellTable can be styled via CSS: How do I style a gwt 2.1 CellTables headers?
To disable highlighting just set the hover CSS property to nothing.
Possibly - try tweaking the .cellTableSelectedRow and .cellTableSelectedRowCell.
Here is the original CellTable.css: http://www.google.com/codesearch/p?hl=en#A1edwVHBClQ/user/src/com/google/gwt/user/cellview/client/CellTable.css&q=cellTableLastColumn&d=8