Java Code Examples for org.eclipse.jface.viewers.StyledString#COUNTER_STYLER

The following examples show how to use org.eclipse.jface.viewers.StyledString#COUNTER_STYLER . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: XViewerTestStyledStringLabelProvider.java    From nebula with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public StyledString getStyledText(Object element, XViewerColumn xCol, int columnIndex) throws XViewerException {
   if (element instanceof String) {
      if (columnIndex == 1) {
         return new StyledString((String) element);
      } else {
         return new StyledString("");
      }
   }
   ISomeTask task = ((ISomeTask) element);
   if (task == null) {
      return new StyledString("");
   }
   if (xCol.equals(MyXViewerFactory.Run_Col)) {
      return new StyledString(String.valueOf(xViewerTest.isRun(task)), StyledString.COUNTER_STYLER);
   }
   if (xCol.equals(MyXViewerFactory.Name_Col)) {
      return new StyledString(task.getId(), StyledString.DECORATIONS_STYLER);
   }
   if (xCol.equals(MyXViewerFactory.Schedule_Time)) {
      return new StyledString(task.getStartTime(), StyledString.QUALIFIER_STYLER);
   }
   if (xCol.equals(MyXViewerFactory.Run_Db)) {
      return new StyledString(task.getRunDb().name(), StyledString.COUNTER_STYLER);
   }
   if (xCol.equals(MyXViewerFactory.Task_Type)) {
      return new StyledString(task.getTaskType().name(), StyledString.DECORATIONS_STYLER);
   }
   if (xCol.equals(MyXViewerFactory.Description)) {
      return new StyledString(task.getDescription(), StyledString.COUNTER_STYLER);
   }
   if (xCol.equals(MyXViewerFactory.Category)) {
      return new StyledString(task.getCategory(), StyledString.DECORATIONS_STYLER);
   }
   if (xCol.equals(MyXViewerFactory.Notification)) {
      return new StyledString(task.getEmailAddress(), StyledString.QUALIFIER_STYLER);
   }
   return new StyledString("unhandled column");
}
 
Example 2
Source File: MyXViewerStyledTextLabelProvider.java    From nebula with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public StyledString getStyledText(Object element, XViewerColumn xCol, int column) throws Exception {
   if (element instanceof String) {
      if (column == 1) {
         return new StyledString((String) element);
      } else {
         return new StyledString("");
      }
   }
   ISomeTask task = ((ISomeTask) element);
   if (task == null) {
      return new StyledString("");
   }
   if (xCol.equals(MyXViewerFactory.Run_Col)) {
      return new StyledString(String.valueOf(xViewerTest.isRun(task)), StyledString.COUNTER_STYLER);
   }
   if (xCol.equals(MyXViewerFactory.Name_Col)) {
      return new StyledString(task.getId(), StyledString.DECORATIONS_STYLER);
   }
   if (xCol.equals(MyXViewerFactory.Schedule_Time)) {
      return new StyledString(task.getStartTime(), StyledString.QUALIFIER_STYLER);
   }
   if (xCol.equals(MyXViewerFactory.Run_Db)) {
      return new StyledString(task.getRunDb().name(), StyledString.COUNTER_STYLER);
   }
   if (xCol.equals(MyXViewerFactory.Task_Type)) {
      return new StyledString(task.getTaskType().name(), StyledString.DECORATIONS_STYLER);
   }
   if (xCol.equals(MyXViewerFactory.Description)) {
      return new StyledString(task.getDescription(), StyledString.COUNTER_STYLER);
   }
   if (xCol.equals(MyXViewerFactory.Category)) {
      return new StyledString(task.getCategory(), StyledString.DECORATIONS_STYLER);
   }
   if (xCol.equals(MyXViewerFactory.Notification)) {
      return new StyledString(task.getEmailAddress(), StyledString.QUALIFIER_STYLER);
   }
   return new StyledString("unhandled column");
}
 
Example 3
Source File: TemplateProposal.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public StyledString getStyledDisplayString() {
	if (fDisplayString == null) {
		String[] arguments= new String[] { fTemplate.getName(), fTemplate.getDescription() };
		String decorated= Messages.format(TemplateContentAssistMessages.TemplateProposal_displayString, arguments);
		StyledString string= new StyledString(fTemplate.getName(), StyledString.COUNTER_STYLER);
		fDisplayString= StyledCellLabelProvider.styleDecoratedString(decorated, StyledString.QUALIFIER_STYLER, string);
	}
	return fDisplayString;
}