Search in sources :

Example 6 with ProjectInfo

use of eu.esdihumboldt.hale.common.core.io.project.ProjectInfo in project hale by halestudio.

the class ResourcesView method createViewControl.

@Override
protected void createViewControl(Composite parent) {
    viewer = new TreeViewer(parent);
    viewer.setContentProvider(new ResourcesContentProvider());
    viewer.setLabelProvider(new ResourcesLabelProvider());
    ProjectService ps = PlatformUI.getWorkbench().getService(ProjectService.class);
    ps.addListener(projectServiceListener = new ProjectServiceAdapter() {

        @Override
        public void resourceAdded(String actionId, Resource resource) {
            updateInDisplayThread();
        }

        @Override
        public void resourcesRemoved(String actionId, List<Resource> resources) {
            updateInDisplayThread();
        }

        @Override
        public void afterLoad(ProjectService projectService) {
            updateInDisplayThread();
        }

        @Override
        public void projectInfoChanged(ProjectInfo info) {
            PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {

                @Override
                public void run() {
                    viewer.update(ProjectToken.TOKEN, null);
                }
            });
        }
    });
    viewer.setUseHashlookup(true);
    viewer.setAutoExpandLevel(3);
    update();
    new ViewerMenu(getSite(), viewer);
    getSite().setSelectionProvider(viewer);
}
Also used : ProjectServiceAdapter(eu.esdihumboldt.hale.ui.service.project.ProjectServiceAdapter) TreeViewer(org.eclipse.jface.viewers.TreeViewer) ResourcesLabelProvider(eu.esdihumboldt.hale.ui.views.resources.internal.ResourcesLabelProvider) Resource(eu.esdihumboldt.hale.common.core.io.project.model.Resource) ProjectInfo(eu.esdihumboldt.hale.common.core.io.project.ProjectInfo) ProjectService(eu.esdihumboldt.hale.ui.service.project.ProjectService) ResourcesContentProvider(eu.esdihumboldt.hale.ui.views.resources.internal.ResourcesContentProvider) List(java.util.List) ViewerMenu(eu.esdihumboldt.hale.ui.util.viewer.ViewerMenu)

Aggregations

ProjectInfo (eu.esdihumboldt.hale.common.core.io.project.ProjectInfo)6 ProjectService (eu.esdihumboldt.hale.ui.service.project.ProjectService)2 Date (java.util.Date)2 ATransaction (de.fhg.igd.slf4jplus.ATransaction)1 AlignmentReader (eu.esdihumboldt.hale.common.align.io.AlignmentReader)1 AlignmentWriter (eu.esdihumboldt.hale.common.align.io.AlignmentWriter)1 LoadAlignmentAdvisor (eu.esdihumboldt.hale.common.align.io.impl.LoadAlignmentAdvisor)1 Alignment (eu.esdihumboldt.hale.common.align.model.Alignment)1 ProjectInfoAware (eu.esdihumboldt.hale.common.core.io.project.ProjectInfoAware)1 ProjectWriter (eu.esdihumboldt.hale.common.core.io.project.ProjectWriter)1 IOConfiguration (eu.esdihumboldt.hale.common.core.io.project.model.IOConfiguration)1 Project (eu.esdihumboldt.hale.common.core.io.project.model.Project)1 Resource (eu.esdihumboldt.hale.common.core.io.project.model.Resource)1 DefaultInputSupplier (eu.esdihumboldt.hale.common.core.io.supplier.DefaultInputSupplier)1 FileIOSupplier (eu.esdihumboldt.hale.common.core.io.supplier.FileIOSupplier)1 LoadSchemaAdvisor (eu.esdihumboldt.hale.common.schema.io.impl.LoadSchemaAdvisor)1 ExampleProject (eu.esdihumboldt.hale.doc.user.examples.internal.extension.ExampleProject)1 Template (eu.esdihumboldt.hale.server.model.Template)1 ProjectServiceAdapter (eu.esdihumboldt.hale.ui.service.project.ProjectServiceAdapter)1 ViewerMenu (eu.esdihumboldt.hale.ui.util.viewer.ViewerMenu)1