use of org.eclipse.mylyn.tasks.core.data.TaskDataModelEvent 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);
}
Aggregations