Search in sources :

Example 6 with TaskRepository

use of org.eclipse.mylyn.tasks.core.TaskRepository in project linuxtools by eclipse.

the class TestOSIORestGetUser method setUp.

@Before
public void setUp() {
    connector = new TestOSIORestConnector();
    repository = new TaskRepository(connector.getConnectorKind(), "http://openshift.io/api");
    repository.setProperty(IOSIORestConstants.REPOSITORY_AUTH_ID, "user");
    repository.setProperty(IOSIORestConstants.REPOSITORY_AUTH_TOKEN, "xxxxxxTokenxxxxxx");
    requestProvider = new OSIOTestRestRequestProvider();
}
Also used : OSIOTestRestRequestProvider(org.eclipse.linuxtools.mylyn.osio.rest.test.support.OSIOTestRestRequestProvider) TaskRepository(org.eclipse.mylyn.tasks.core.TaskRepository) Before(org.junit.Before)

Example 7 with TaskRepository

use of org.eclipse.mylyn.tasks.core.TaskRepository in project linuxtools by eclipse.

the class TestOSIORestPatchUpdateTask method setUp.

@Before
public void setUp() {
    connector = new TestOSIORestConnector();
    repository = new TaskRepository(connector.getConnectorKind(), "http://openshift.io/api");
    repository.setProperty(IOSIORestConstants.REPOSITORY_AUTH_ID, "user");
    repository.setProperty(IOSIORestConstants.REPOSITORY_AUTH_TOKEN, "xxxxxxTokenxxxxxx");
    requestProvider = new OSIOTestRestRequestProvider();
}
Also used : OSIOTestRestRequestProvider(org.eclipse.linuxtools.mylyn.osio.rest.test.support.OSIOTestRestRequestProvider) TaskRepository(org.eclipse.mylyn.tasks.core.TaskRepository) Before(org.junit.Before)

Example 8 with TaskRepository

use of org.eclipse.mylyn.tasks.core.TaskRepository in project linuxtools by eclipse.

the class TestOSIORestPostNewLabel method setUp.

@Before
public void setUp() {
    connector = new TestOSIORestConnector();
    repository = new TaskRepository(connector.getConnectorKind(), "http://openshift.io/api");
    repository.setProperty(IOSIORestConstants.REPOSITORY_AUTH_ID, "user");
    repository.setProperty(IOSIORestConstants.REPOSITORY_AUTH_TOKEN, "xxxxxxTokenxxxxxx");
    requestProvider = new OSIOTestRestRequestProvider();
}
Also used : OSIOTestRestRequestProvider(org.eclipse.linuxtools.mylyn.osio.rest.test.support.OSIOTestRestRequestProvider) TaskRepository(org.eclipse.mylyn.tasks.core.TaskRepository) Before(org.junit.Before)

Example 9 with TaskRepository

use of org.eclipse.mylyn.tasks.core.TaskRepository in project linuxtools by eclipse.

the class OSIORestTestFixture method repository.

public TaskRepository repository() {
    if (repository != null) {
        return repository;
    }
    repository = new TaskRepository(getConnectorKind(), getRepositoryUrl());
    UserCredentials credentials = CommonTestUtil.getCredentials(PrivilegeLevel.USER);
    repository.setCredentials(org.eclipse.mylyn.commons.net.AuthenticationType.REPOSITORY, new AuthenticationCredentials(credentials.getUserName(), credentials.getPassword()), true);
    return repository;
}
Also used : AuthenticationCredentials(org.eclipse.mylyn.commons.net.AuthenticationCredentials) TaskRepository(org.eclipse.mylyn.tasks.core.TaskRepository) UserCredentials(org.eclipse.mylyn.commons.repositories.core.auth.UserCredentials)

Example 10 with TaskRepository

use of org.eclipse.mylyn.tasks.core.TaskRepository in project linuxtools by eclipse.

the class RepositoryQuerySchemaPage method createPageContent.

@Override
protected void createPageContent(@NonNull SectionComposite parent) {
    this.scrolledComposite = parent;
    Composite scrolledBodyComposite = scrolledComposite.getContent();
    GridLayout layout = new GridLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 10;
    layout.horizontalSpacing = 0;
    layout.verticalSpacing = 10;
    scrolledBodyComposite.setLayout(layout);
    Composite attributesComposite = new Composite(scrolledBodyComposite, SWT.NONE);
    GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).span(2, 1).applyTo(attributesComposite);
    layout = new GridLayout(6, false);
    layout.marginHeight = 20;
    layout.marginWidth = 10;
    attributesComposite.setLayout(layout);
    GridData g = new GridData(GridData.FILL, GridData.FILL, true, true);
    g.widthHint = 600;
    attributesComposite.setLayoutData(g);
    attributesComposite.setForeground(parent.getDisplay().getSystemColor(SWT.COLOR_LIST_FOREGROUND));
    FormToolkit toolkit = new FormToolkit(parent.getDisplay());
    TaskRepository repository = getTaskRepository();
    ITask nTask = new TaskTask(repository.getConnectorKind(), repository.getRepositoryUrl(), data.getTaskId());
    ITaskDataWorkingCopy workingCopy = TasksUi.getTaskDataManager().createWorkingCopy(nTask, data);
    final TaskDataModel model = new TaskDataModel(repository, nTask, workingCopy);
    factory = new RepositoryQueryAttributeEditorFactory(model, repository);
    model.addModelListener(new TaskDataModelListener() {

        @Override
        public void attributeChanged(TaskDataModelEvent event) {
            getContainer().updateButtons();
        }
    });
    targetTaskData = workingCopy.getLocalData();
    final TaskAttribute target = targetTaskData.getRoot();
    createFieldControls(attributesComposite, toolkit, layout.numColumns, target);
    Point p = scrolledBodyComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
    scrolledComposite.setMinSize(p);
}
Also used : TaskAttribute(org.eclipse.mylyn.tasks.core.data.TaskAttribute) ITask(org.eclipse.mylyn.tasks.core.ITask) SectionComposite(org.eclipse.mylyn.commons.workbench.forms.SectionComposite) Composite(org.eclipse.swt.widgets.Composite) FormToolkit(org.eclipse.ui.forms.widgets.FormToolkit) TaskRepository(org.eclipse.mylyn.tasks.core.TaskRepository) TaskDataModelEvent(org.eclipse.mylyn.tasks.core.data.TaskDataModelEvent) Point(org.eclipse.swt.graphics.Point) TaskTask(org.eclipse.mylyn.internal.tasks.core.TaskTask) GridLayout(org.eclipse.swt.layout.GridLayout) GridData(org.eclipse.swt.layout.GridData) TaskDataModelListener(org.eclipse.mylyn.tasks.core.data.TaskDataModelListener) ITaskDataWorkingCopy(org.eclipse.mylyn.tasks.core.data.ITaskDataWorkingCopy) TaskDataModel(org.eclipse.mylyn.tasks.core.data.TaskDataModel)

Aggregations

TaskRepository (org.eclipse.mylyn.tasks.core.TaskRepository)18 OSIOTestRestRequestProvider (org.eclipse.linuxtools.mylyn.osio.rest.test.support.OSIOTestRestRequestProvider)16 Before (org.junit.Before)16 Date (java.sql.Date)1 OSIORestConnector (org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestConnector)1 Identity (org.eclipse.linuxtools.internal.mylyn.osio.rest.core.response.data.Identity)1 AuthenticationCredentials (org.eclipse.mylyn.commons.net.AuthenticationCredentials)1 UserCredentials (org.eclipse.mylyn.commons.repositories.core.auth.UserCredentials)1 SectionComposite (org.eclipse.mylyn.commons.workbench.forms.SectionComposite)1 TaskTask (org.eclipse.mylyn.internal.tasks.core.TaskTask)1 ITask (org.eclipse.mylyn.tasks.core.ITask)1 ITaskDataWorkingCopy (org.eclipse.mylyn.tasks.core.data.ITaskDataWorkingCopy)1 TaskAttribute (org.eclipse.mylyn.tasks.core.data.TaskAttribute)1 TaskDataModel (org.eclipse.mylyn.tasks.core.data.TaskDataModel)1 TaskDataModelEvent (org.eclipse.mylyn.tasks.core.data.TaskDataModelEvent)1 TaskDataModelListener (org.eclipse.mylyn.tasks.core.data.TaskDataModelListener)1 Point (org.eclipse.swt.graphics.Point)1 GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Composite (org.eclipse.swt.widgets.Composite)1