Search in sources :

Example 1 with ProjectService

use of eu.esdihumboldt.hale.ui.service.project.ProjectService in project hale by halestudio.

the class OpenDocumentEventProcessor method openFiles.

/**
 * Open waiting files
 */
public void openFiles() {
    // project service is needed
    ProjectService ps = PlatformUI.getWorkbench().getService(ProjectService.class);
    if (ps == null) {
        return;
    }
    String[] filePaths;
    synchronized (filesToOpen) {
        if (filesToOpen.isEmpty())
            return;
        filePaths = filesToOpen.toArray(new String[filesToOpen.size()]);
        filesToOpen.clear();
    }
    // open files
    // currently only projects are supported and one project will override
    // another, so just take the last file
    String path = filePaths[filePaths.length - 1];
    File file = new File(path);
    ps.load(file.toURI());
}
Also used : ProjectService(eu.esdihumboldt.hale.ui.service.project.ProjectService) File(java.io.File)

Example 2 with ProjectService

use of eu.esdihumboldt.hale.ui.service.project.ProjectService in project hale by halestudio.

the class HaleConnectProjectExportAdvisor method prepareProvider.

@Override
public void prepareProvider(HaleConnectProjectWriter provider) {
    super.prepareProvider(provider);
    ProjectService projectService = getService(ProjectService.class);
    Project project = (Project) projectService.getProjectInfo();
    provider.setProject(project);
}
Also used : Project(eu.esdihumboldt.hale.common.core.io.project.model.Project) ProjectService(eu.esdihumboldt.hale.ui.service.project.ProjectService)

Example 3 with ProjectService

use of eu.esdihumboldt.hale.ui.service.project.ProjectService in project hale by halestudio.

the class NotesCellSection method createControls.

@Override
public void createControls(Composite parent, TabbedPropertySheetPage aTabbedPropertySheetPage) {
    super.createControls(parent, aTabbedPropertySheetPage);
    Composite page = getWidgetFactory().createComposite(parent);
    page.setLayout(GridLayoutFactory.fillDefaults().margins(8, 8).create());
    textField = new Text(page, SWT.MULTI | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL);
    textField.setLayoutData(GridDataFactory.fillDefaults().hint(17, 17).grab(true, true).create());
    textField.addModifyListener(new ModifyListener() {

        @Override
        public void modifyText(ModifyEvent e) {
            Cell cell = getCell();
            if (cell != null && !cell.isBaseCell()) {
                String cellNotes = CellUtil.getNotes(cell);
                if (cellNotes == null) {
                    cellNotes = "";
                }
                String notes = textField.getText();
                if (!notes.equals(cellNotes)) {
                    CellUtil.setNotes(cell, notes);
                    ProjectService ps = PlatformUI.getWorkbench().getService(ProjectService.class);
                    if (ps != null) {
                        ps.setChanged();
                    }
                }
            }
        }
    });
}
Also used : ModifyEvent(org.eclipse.swt.events.ModifyEvent) Composite(org.eclipse.swt.widgets.Composite) ModifyListener(org.eclipse.swt.events.ModifyListener) ProjectService(eu.esdihumboldt.hale.ui.service.project.ProjectService) Text(org.eclipse.swt.widgets.Text) Cell(eu.esdihumboldt.hale.common.align.model.Cell)

Example 4 with ProjectService

use of eu.esdihumboldt.hale.ui.service.project.ProjectService in project hale by halestudio.

the class URLTargetURIFieldEditor method updateHistory.

/**
 * Update the URL history (project specific).
 */
public void updateHistory() {
    ProjectService ps = PlatformUI.getWorkbench().getService(ProjectService.class);
    final List<String> locations = ps.getConfigurationService().getList(SETTING_URL_HISTORY);
    if (locations != null && !locations.isEmpty()) {
        historyButton.setEnabled(true);
    } else {
        historyButton.setEnabled(false);
    }
}
Also used : ProjectService(eu.esdihumboldt.hale.ui.service.project.ProjectService)

Example 5 with ProjectService

use of eu.esdihumboldt.hale.ui.service.project.ProjectService in project hale by halestudio.

the class UserFallbackEntityResolver method resetCache.

/**
 * Reset the resolve cache.
 */
public static void resetCache() {
    ProjectService ps = HaleUI.getServiceProvider().getService(ProjectService.class);
    ps.setTemporaryProperty(PROPERTY_RESOLVE_CACHE, Value.of(new ResolveCache()));
}
Also used : ResolveCache(eu.esdihumboldt.hale.ui.service.align.resolver.internal.ResolveCache) ProjectService(eu.esdihumboldt.hale.ui.service.project.ProjectService)

Aggregations

ProjectService (eu.esdihumboldt.hale.ui.service.project.ProjectService)49 IOConfiguration (eu.esdihumboldt.hale.common.core.io.project.model.IOConfiguration)5 Resource (eu.esdihumboldt.hale.common.core.io.project.model.Resource)5 URI (java.net.URI)5 ArrayList (java.util.ArrayList)5 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)5 SelectionEvent (org.eclipse.swt.events.SelectionEvent)5 Button (org.eclipse.swt.widgets.Button)5 Value (eu.esdihumboldt.hale.common.core.io.Value)4 ResolveCache (eu.esdihumboldt.hale.ui.service.align.resolver.internal.ResolveCache)4 InvocationTargetException (java.lang.reflect.InvocationTargetException)4 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)4 IRunnableWithProgress (org.eclipse.jface.operation.IRunnableWithProgress)4 Project (eu.esdihumboldt.hale.common.core.io.project.model.Project)3 SchemaService (eu.esdihumboldt.hale.ui.service.schema.SchemaService)3 List (java.util.List)3 Composite (org.eclipse.swt.widgets.Composite)3 EntityDefinition (eu.esdihumboldt.hale.common.align.model.EntityDefinition)2 PropertyEntityDefinition (eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition)2 TypeEntityDefinition (eu.esdihumboldt.hale.common.align.model.impl.TypeEntityDefinition)2