當前位置: 首頁>>代碼示例>>Java>>正文


Java TaskSettings.getInstance方法代碼示例

本文整理匯總了Java中com.intellij.tasks.config.TaskSettings.getInstance方法的典型用法代碼示例。如果您正苦於以下問題:Java TaskSettings.getInstance方法的具體用法?Java TaskSettings.getInstance怎麽用?Java TaskSettings.getInstance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.tasks.config.TaskSettings的用法示例。


在下文中一共展示了TaskSettings.getInstance方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: update

import com.intellij.tasks.config.TaskSettings; //導入方法依賴的package包/類
@Override
public void update(AnActionEvent e) {
  Presentation presentation = e.getPresentation();
  Project project = e.getData(CommonDataKeys.PROJECT);
  ComboBoxButton button = (ComboBoxButton)presentation.getClientProperty(CUSTOM_COMPONENT_PROPERTY);
  if (project == null || project.isDefault() || project.isDisposed() || button == null) {
    presentation.setEnabled(false);
    presentation.setText("");
    presentation.setIcon(null);
  }
  else {
    TaskManager taskManager = TaskManager.getManager(project);
    LocalTask activeTask = taskManager.getActiveTask();
    presentation.setVisible(true);
    presentation.setEnabled(true);

    if (isImplicit(activeTask) &&
        taskManager.getAllRepositories().length == 0 &&
        !TaskSettings.getInstance().ALWAYS_DISPLAY_COMBO) {
      presentation.setVisible(false);
    }
    else {
      String s = getText(activeTask);
      presentation.setText(s);
      presentation.setIcon(activeTask.getIcon());
      presentation.setDescription(activeTask.getSummary());
    }
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:30,代碼來源:SwitchTaskCombo.java

示例2: createRequestConfig

import com.intellij.tasks.config.TaskSettings; //導入方法依賴的package包/類
@NotNull
protected RequestConfig createRequestConfig() {
  TaskSettings tasksSettings = TaskSettings.getInstance();
  RequestConfig.Builder builder = RequestConfig.custom()
    .setConnectTimeout(3000)
    .setSocketTimeout(tasksSettings.CONNECTION_TIMEOUT);
  if (isUseProxy()) {
    IdeHttpClientHelpers.ApacheHttpClient4.setProxyForUrlIfEnabled(builder, getUrl());
  }

  return builder.build();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:13,代碼來源:NewBaseRepositoryImpl.java

示例3: setUp

import com.intellij.tasks.config.TaskSettings; //導入方法依賴的package包/類
@Override
public void setUp() throws Exception {
  super.setUp();
  TaskSettings.getInstance().CONNECTION_TIMEOUT = 20000;
  myRepository = new JiraRepository(new JiraRepositoryType());
  myRepository.setUrl(JIRA_5_TEST_SERVER_URL);
  myRepository.setUsername("buildtest");
  myRepository.setPassword("buildtest");
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:10,代碼來源:JiraIntegrationTest.java

示例4: update

import com.intellij.tasks.config.TaskSettings; //導入方法依賴的package包/類
@Override
public void update(AnActionEvent e) {
  Project project = e.getData(PlatformDataKeys.PROJECT);
  Presentation presentation = e.getPresentation();
  if (project == null || project.isDisposed() || (ActionPlaces.MAIN_MENU.equals(e.getPlace()) && findFrame(e) == null)) {
    presentation.setEnabled(false);
    presentation.setText("");
    presentation.setIcon(null);
  }
  else {
    TaskManager taskManager = TaskManager.getManager(project);
    LocalTask activeTask = taskManager.getActiveTask();
    presentation.setVisible(true);
    presentation.setEnabled(true);

    if (isImplicit(activeTask) &&
        taskManager.getAllRepositories().length == 0 &&
        !TaskSettings.getInstance().ALWAYS_DISPLAY_COMBO) {
      presentation.setVisible(false);
    }
    else {
      String s = getText(activeTask);
      presentation.setText(s);
      presentation.setIcon(activeTask.getIcon());
      presentation.setDescription(activeTask.getSummary());
    }
  }
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:29,代碼來源:SwitchTaskCombo.java

示例5: testTaskComboVisible

import com.intellij.tasks.config.TaskSettings; //導入方法依賴的package包/類
public void testTaskComboVisible() throws Exception {

    TaskManager manager = TaskManager.getManager(getProject());
    SwitchTaskCombo combo = new SwitchTaskCombo();

    LocalTask defaultTask = manager.getActiveTask();
    assertTrue(defaultTask.isDefault());
    assertEquals(defaultTask.getCreated(), defaultTask.getUpdated());

    Presentation presentation = doTest(combo);
    assertFalse(presentation.isVisible());

    try {
      TaskSettings.getInstance().ALWAYS_DISPLAY_COMBO = true;
      presentation = doTest(combo);
      assertTrue(presentation.isVisible());
    }
    finally {
      TaskSettings.getInstance().ALWAYS_DISPLAY_COMBO = false;
    }

    LocalTask task = manager.createLocalTask("test");
    manager.activateTask(task, false);

    presentation = doTest(combo);
    assertTrue(presentation.isVisible());

    manager.activateTask(defaultTask, false);
    task = manager.getActiveTask();
    assertTrue(task.isDefault());

    presentation = doTest(combo);
    if (!presentation.isVisible()) {
      LocalTask activeTask = manager.getActiveTask();
      System.out.println(activeTask);
      System.out.println(activeTask.getCreated());
      System.out.println(activeTask.getUpdated());
      fail();
    }
  }
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:41,代碼來源:TaskUiTest.java

示例6: update

import com.intellij.tasks.config.TaskSettings; //導入方法依賴的package包/類
@Override
public void update(AnActionEvent e)
{
	Presentation presentation = e.getPresentation();
	Project project = e.getData(CommonDataKeys.PROJECT);
	ComboBoxButton button = (ComboBoxButton) presentation.getClientProperty(CUSTOM_COMPONENT_PROPERTY);
	if(project == null || project.isDefault() || project.isDisposed() || button == null)
	{
		presentation.setEnabled(false);
		presentation.setText("");
		presentation.setIcon(null);
	}
	else
	{
		TaskManager taskManager = TaskManager.getManager(project);
		LocalTask activeTask = taskManager.getActiveTask();
		presentation.setVisible(true);
		presentation.setEnabled(true);

		if(isImplicit(activeTask) && taskManager.getAllRepositories().length == 0 && !TaskSettings.getInstance().ALWAYS_DISPLAY_COMBO)
		{
			presentation.setVisible(false);
		}
		else
		{
			String s = getText(activeTask);
			presentation.setText(s);
			presentation.setIcon(activeTask.getIcon());
			presentation.setDescription(activeTask.getSummary());
		}
	}
}
 
開發者ID:consulo,項目名稱:consulo-tasks,代碼行數:33,代碼來源:SwitchTaskCombo.java

示例7: createRequestConfig

import com.intellij.tasks.config.TaskSettings; //導入方法依賴的package包/類
@NotNull
protected RequestConfig createRequestConfig()
{
	TaskSettings tasksSettings = TaskSettings.getInstance();
	RequestConfig.Builder builder = RequestConfig.custom().setConnectTimeout(3000).setSocketTimeout(tasksSettings.CONNECTION_TIMEOUT);
	if(isUseProxy())
	{
		IdeHttpClientHelpers.ApacheHttpClient4.setProxyForUrlIfEnabled(builder, getUrl());
	}

	return builder.build();
}
 
開發者ID:consulo,項目名稱:consulo-tasks,代碼行數:13,代碼來源:NewBaseRepositoryImpl.java


注:本文中的com.intellij.tasks.config.TaskSettings.getInstance方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。