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


Java TaskSettings類代碼示例

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


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

示例1: configureHttpClient

import com.intellij.tasks.config.TaskSettings; //導入依賴的package包/類
protected void configureHttpClient(HttpClient client) {
  client.getParams().setConnectionManagerTimeout(3000);
  client.getParams().setSoTimeout(TaskSettings.getInstance().CONNECTION_TIMEOUT);
  if (isUseProxy()) {
    HttpConfigurable proxy = HttpConfigurable.getInstance();
    client.getHostConfiguration().setProxy(proxy.PROXY_HOST, proxy.PROXY_PORT);
    if (proxy.PROXY_AUTHENTICATION) {
      AuthScope authScope = new AuthScope(proxy.PROXY_HOST, proxy.PROXY_PORT);
      Credentials credentials = getCredentials(proxy.PROXY_LOGIN, proxy.getPlainProxyPassword(), proxy.PROXY_HOST);
      client.getState().setProxyCredentials(authScope, credentials);
    }
  }
  if (isUseHttpAuthentication()) {
    client.getParams().setCredentialCharset("UTF-8");
    client.getParams().setAuthenticationPreemptive(true);
    client.getState().setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(getUsername(), getPassword()));
  }
  else {
    client.getState().clearCredentials();
    client.getParams().setAuthenticationPreemptive(false);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:23,代碼來源:BaseRepositoryImpl.java

示例2: configureHttpClient

import com.intellij.tasks.config.TaskSettings; //導入依賴的package包/類
protected void configureHttpClient(HttpClient client) {
  client.getParams().setConnectionManagerTimeout(3000);
  client.getParams().setSoTimeout(TaskSettings.getInstance().CONNECTION_TIMEOUT);
  if (isUseProxy()) {
    HttpConfigurable proxy = HttpConfigurable.getInstance();
    client.getHostConfiguration().setProxy(proxy.PROXY_HOST, proxy.PROXY_PORT);
    if (proxy.PROXY_AUTHENTICATION) {
      AuthScope authScope = new AuthScope(proxy.PROXY_HOST, proxy.PROXY_PORT);
      Credentials credentials = getCredentials(proxy.PROXY_LOGIN, proxy.getPlainProxyPassword(), proxy.PROXY_HOST);
      client.getState().setProxyCredentials(authScope, credentials);
    }
  }
  if (isUseHttpAuthentication()) {
    client.getParams().setCredentialCharset("UTF-8");
    client.getParams().setAuthenticationPreemptive(true);
    client.getState().setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(getUsername(), getPassword()));
  }
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:19,代碼來源:BaseRepositoryImpl.java

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例10: configureHttpClient

import com.intellij.tasks.config.TaskSettings; //導入依賴的package包/類
protected void configureHttpClient(HttpClient client)
{
	client.getParams().setConnectionManagerTimeout(3000);
	client.getParams().setSoTimeout(TaskSettings.getInstance().CONNECTION_TIMEOUT);
	if(isUseProxy())
	{
		HttpConfigurable proxy = HttpConfigurable.getInstance();
		client.getHostConfiguration().setProxy(proxy.PROXY_HOST, proxy.PROXY_PORT);
		if(proxy.PROXY_AUTHENTICATION)
		{
			AuthScope authScope = new AuthScope(proxy.PROXY_HOST, proxy.PROXY_PORT);
			Credentials credentials = getCredentials(proxy.getProxyLogin(), proxy.getPlainProxyPassword(), proxy.PROXY_HOST);
			client.getState().setProxyCredentials(authScope, credentials);
		}
	}
	if(isUseHttpAuthentication())
	{
		client.getParams().setCredentialCharset("UTF-8");
		client.getParams().setAuthenticationPreemptive(true);
		client.getState().setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(getUsername(), getPassword()));
	}
	else
	{
		client.getState().clearCredentials();
		client.getParams().setAuthenticationPreemptive(false);
	}
}
 
開發者ID:consulo,項目名稱:consulo-tasks,代碼行數:28,代碼來源:BaseRepositoryImpl.java


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