예제 #1
0
  private void updateHeaderLabel() {
    TaskRepository outgoingNewRepository = TasksUiUtil.getOutgoingNewTaskRepository(task);
    final TaskRepository taskRepository =
        (outgoingNewRepository != null)
            ? outgoingNewRepository
            : taskEditorInput.getTaskRepository();

    //		if (taskRepository.getConnectorKind().equals(LocalRepositoryConnector.CONNECTOR_KIND)) {
    //			getHeaderForm().getForm().setText(Messages.TaskEditor_Task_ + task.getSummary());
    //		} else {
    AbstractRepositoryConnectorUi connectorUi =
        TasksUiPlugin.getConnectorUi(taskRepository.getConnectorKind());
    String kindLabel = Messages.TaskEditor_Task;
    if (connectorUi != null) {
      kindLabel = connectorUi.getTaskKindLabel(task);
    }

    String idLabel = task.getTaskKey();
    if (idLabel != null) {
      kindLabel += " " + idLabel; // $NON-NLS-1$
    }

    if (hasLeftToolBar() && titleLabel != null) {
      titleLabel.setText(kindLabel);
      getHeaderForm().getForm().setText(null);
      setHeaderImage(null);
    } else {
      getHeaderForm().getForm().setText(kindLabel);
    }
  }
  @Deprecated
  public void promptToAddQuery(TaskRepository taskRepository) {
    IPreferenceStore preferenceStore = TasksUiPlugin.getDefault().getPreferenceStore();
    if (!preferenceStore.getBoolean(PREF_ADD_QUERY)) {
      Shell shell = PlatformUI.getWorkbench().getDisplay().getActiveShell();
      MessageDialogWithToggle messageDialog =
          MessageDialogWithToggle.openYesNoQuestion(
              shell,
              Messages.AddRepositoryAction_Add_new_query,
              Messages.AddRepositoryAction_Add_a_query_to_the_Task_List,
              Messages.AddRepositoryAction_Do_not_show_again,
              false,
              preferenceStore,
              PREF_ADD_QUERY);
      preferenceStore.setValue(PREF_ADD_QUERY, messageDialog.getToggleState());
      if (messageDialog.getReturnCode() == IDialogConstants.YES_ID) {
        AbstractRepositoryConnectorUi connectorUi =
            TasksUiPlugin.getConnectorUi(taskRepository.getConnectorKind());
        IWizard queryWizard = connectorUi.getQueryWizard(taskRepository, null);
        if (queryWizard instanceof Wizard) {
          ((Wizard) queryWizard).setForcePreviousAndNextButtons(true);
        }

        WizardDialog queryDialog = new WizardDialog(shell, queryWizard);
        queryDialog.create();
        queryDialog.setBlockOnOpen(true);
        queryDialog.open();
      }
    }
  }
예제 #3
0
 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));
   }
 }