コード例 #1
0
ファイル: TaskEditor.java プロジェクト: harishpalk/mylyn_3.17
 private void updateTitleImage() {
   if (task != null) {
     AbstractRepositoryConnectorUi connectorUi =
         TasksUiPlugin.getConnectorUi(task.getConnectorKind());
     if (connectorUi != null) {
       ImageDescriptor overlayDescriptor = connectorUi.getTaskKindOverlay(task);
       setTitleImage(
           CommonImages.getCompositeTaskImage(TasksUiImages.TASK, overlayDescriptor, false));
     } else {
       setTitleImage(CommonImages.getImage(TasksUiImages.TASK));
     }
     //		} else if (getEditorInput() instanceof AbstractRepositoryTaskEditorInput) {
     //			setTitleImage(CommonImages.getImage(TasksUiImages.TASK_REMOTE));
   } else {
     setTitleImage(CommonImages.getImage(TasksUiImages.TASK));
   }
 }
コード例 #2
0
  @Override
  public Image getImage(Object element) {
    ImageDescriptor descriptor = null;
    ImageDescriptor bottomLeftDecoration = null;
    ImageDescriptor bottomRightDecoration = null;
    ImageDescriptor topRightDecoration = null;

    // bottom left decoration
    if (element instanceof IBuildElement) {
      bottomLeftDecoration = getBottomLeftDecoration((IBuildElement) element);
    }

    // main image
    if (element instanceof IBuildServer) {
      if (((IBuildServer) element).getLocation().isOffline()) {
        descriptor = BuildImages.SERVER_DISABLED;
      } else {
        descriptor = BuildImages.SERVER;
      }
    } else if (element instanceof IBuildPlan) {
      descriptor = getImageDescriptor(((IBuildPlan) element).getStatus());
      bottomRightDecoration = getBottomRightDecoration(((IBuildPlan) element).getState());
      topRightDecoration = getTopRightDecoration(((IBuildPlan) element).getFlags());
    } else if (element instanceof IBuild) {
      descriptor = BuildLabelProvider.getImageDescriptor(((IBuild) element).getStatus());
      bottomRightDecoration = getBottomRightDecoration(((IBuild) element).getState());
    }

    if (descriptor != null) {
      if (bottomRightDecoration != null
          || bottomLeftDecoration != null
          || topRightDecoration != null) {
        descriptor =
            new DecorationOverlayIcon(
                CommonImages.getImage(descriptor),
                new ImageDescriptor[] {
                  null, topRightDecoration, bottomLeftDecoration, bottomRightDecoration
                });
      }
      return CommonImages.getImage(descriptor);
    }
    return null;
  }
コード例 #3
0
  @Test
  public void imageNotPresentTests() {

    // check that all images are null when they should be
    assertNotNull(myLabelProvider.getColumnImage(myTaskReview1, 0));
    assertNotNull(myLabelProvider.getColumnImage(myTaskReview1, 1));
    assertNotNull(myLabelProvider.getColumnImage(myTaskReview1, 2));
    assertNotNull(myLabelProvider.getColumnImage(myTaskReview1, 3));

    assertEquals(
        CommonImages.getImage(CommonImages.OVERLAY_CLEAR),
        myLabelProvider.getColumnImage(myTaskReview1, 0));
    assertEquals(
        CommonImages.getImage(CommonImages.OVERLAY_CLEAR),
        myLabelProvider.getColumnImage(myTaskReview1, 0));
    assertEquals(
        CommonImages.getImage(CommonImages.OVERLAY_CLEAR),
        myLabelProvider.getColumnImage(myTaskReview1, 0));
    assertEquals(
        CommonImages.getImage(CommonImages.OVERLAY_CLEAR),
        myLabelProvider.getColumnImage(myTaskReview1, 0));
  }
コード例 #4
0
ファイル: TaskEditor.java プロジェクト: harishpalk/mylyn_3.17
  private Image getBrandingImage() {
    String connectorKind;
    TaskRepository outgoingNewRepository = TasksUiUtil.getOutgoingNewTaskRepository(task);
    if (outgoingNewRepository != null) {
      connectorKind = outgoingNewRepository.getConnectorKind();
    } else {
      connectorKind = task.getConnectorKind();
    }

    if (LocalRepositoryConnector.CONNECTOR_KIND.equals(connectorKind)) {
      return CommonImages.getImage(TasksUiImages.TASK);
    } else {
      ImageDescriptor overlay;
      if (outgoingNewRepository != null) {
        overlay =
            TasksUiPlugin.getDefault().getBrandManager().getOverlayIcon(outgoingNewRepository);
      } else {
        overlay = TasksUiPlugin.getDefault().getBrandManager().getOverlayIcon(task);
      }
      Image image =
          CommonImages.getImageWithOverlay(TasksUiImages.REPOSITORY, overlay, false, false);
      return image;
    }
  }
コード例 #5
0
 @Override
 protected IFigure createFigure() {
   Label l = (Label) super.createFigure();
   l.setIcon(CommonImages.getImage(BatchImages.END));
   return l;
 }