[GARD] I’ve been trying to style my eclipse 4 app using the new CSS style selectors. Specifically I was trying to remove the minimise and maximise icons from a PartStack as it was the only item in a perspective, and the perspective layout made no sense when it was minimised.

It’s highly recommended to give CSS Spy a run (installed from the e4 Tools update site). CSS Spy lets you find the CSS class names associated with various items in the eclipse workspace.

It’s also very handy to know that you can select items based on their ‘tags’. Most items can be tagged in the ‘Supplementary’ section of the Application.e4xmi file. I applied the tag ‘singlePartStack’ to any part stacks that I wished to only show one tab at a time.

I’m still not quite sure why some items (e.g. Label and other SWT components) are defined as CSS elements, whilst others (.MPartStack in the example below) are styled via a class.

/* Make all label text 9px in size */
Label {
  font-size: 9px;
}

/* Style all MPartStacks with no minimise or maximise buttons */
.MPartStack {
  swt-minimize-visible: false;
  swt-maximize-visible: false;
}

/* Items tagged as singlePartStack only show one tab at a time */
.singlePartStack {
  swt-single: true;
}

[GARD]


COMMENTS