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());
}
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);
}
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();
}
}
}
}
});
}
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);
}
}
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()));
}
Aggregations