Package org.eclipse.jface.viewers.StyledString

Examples of org.eclipse.jface.viewers.StyledString.Styler


        } else {
          image = "red-dot.png";
        }
      }
      if (status != null) {
        Styler style = null;
        StyledString styledString = new StyledString(status, style);
        cell.setText(styledString.toString());
        cell.setStyleRanges(styledString.getStyleRanges());
      }
      if (image != null) {
View Full Code Here


            if (data instanceof HierarchyNodeModel) {
                HierarchyNodeModel model = (HierarchyNodeModel) data;
                String spaces = "     ";
                StyledString styledString = new StyledString(model.name + spaces);
                if (model.moduleName != null && model.moduleName.trim().length() > 0) {
                    Styler styler = StyledString.createColorRegistryStyler(JFacePreferences.DECORATIONS_COLOR, null);
                    styledString.append("(" + model.moduleName + ")", styler);
                }
                return styledString;
            }
            return new StyledString(data.toString());
View Full Code Here

                            final Color color = color( decoration.color() );
                           
                            styledString.append
                            (
                                " " + text,
                                new Styler()
                                {
                                    @Override
                                    public void applyStyles( final TextStyle style )
                                    {
                                        style.foreground = color;
View Full Code Here

    private final Styler  errorStyler;
    private final Styler  passStyler;

    public ViewLabelProvider() {
      errorStyler = new Styler() {
        @Override
        public void applyStyles(TextStyle textStyle) {
          // textStyle.font = boldFont;
          textStyle.foreground = new Color(instance.display, new RGB(200, 0, 0));
        }
      };

      passStyler = new Styler() {
        @Override
        public void applyStyles(TextStyle textStyle) {
          // textStyle.font = boldFont;
          textStyle.foreground = new Color(instance.display, new RGB(0, 200, 0));
        }
View Full Code Here

      Object element = cell.getElement();

      if (element instanceof TestFile) {
        TestFile file = (TestFile) element;

        Styler style = !file.passed() ? errorStyler : null;

        StyledString styledString = new StyledString(file.getName(), style);
        String decoration = MessageFormat.format(
                " ({0} bytes)", new Object[] { new Long(file.getName().length()) }); //$NON-NLS-1$
        styledString.append(decoration, StyledString.COUNTER_STYLER);
View Full Code Here

  }

  public Object text(Task task){
    String text = delegate.getText(task);
    if(task.isDone()){
      Styler style = stylerFactory.createXtextStyleAdapterStyler(configuration.taskDoneTextStyle());
      return new StyledString(text, style);
    }else{
      return text;
    }
  }
View Full Code Here

  }
 
 
  public StyledString getStyledText(Object element) {
    if (element instanceof Content && ((Content)element).isDone()) {
      Styler style = stylerFactory.createXtextStyleAdapterStyler(configuration.taskDoneTextStyle());
      return new StyledString(getText(element), style );
    }else{
      return new StyledString(getText(element));
    }
  }
View Full Code Here

  public void update(ViewerCell cell)
  {

    Object element = cell.getElement();
   
    Styler style = null;
   
    if (element instanceof IProject) {
     
      IProject project = (IProject) element;     
      StyledString styledString = new StyledString(project.getName(), style);     
View Full Code Here

TOP

Related Classes of org.eclipse.jface.viewers.StyledString.Styler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.