Java Code Examples for org.eclipse.core.resources.IFile#getPersistentProperty()

The following examples show how to use org.eclipse.core.resources.IFile#getPersistentProperty() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
public IEditorDescriptor findXbaseEditor(IEditorInput editorInput, boolean ignorePreference) {
	IFile file = ResourceUtil.getFile(editorInput);
	if (file == null)
		return null;
	if (!ignorePreference) {
		if (file.exists()) {
			try {
				String favoriteEditor = file.getPersistentProperty(IDE.EDITOR_KEY);
				if (favoriteEditor != null)
					return null;
			} catch (CoreException e) {
				logger.debug(e.getMessage(), e);
			}
		}
	}
	// TODO stay in same editor if local navigation
	Decision decision = decisions.decideAccordingToCaller();
	if (decision == Decision.FORCE_JAVA) {
		return null;
	}
	IEclipseTrace traceToSource = traceInformation.getTraceToSource(file);
	return getXtextEditor(traceToSource);
}
 
Example 2
@Override
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {

    if (IS_EXPERIMENT_EDITOR_INPUT.equals(property)) {
        if (receiver instanceof IFileEditorInput) {
            IFileEditorInput editorInput = (IFileEditorInput) receiver;
            IFile file = editorInput.getFile();
            if (file != null) {
                try {
                    final String traceTypeId = file.getPersistentProperty(TmfCommonConstants.TRACETYPE);
                    if (traceTypeId != null && ITmfEventsEditorConstants.EXPERIMENT_INPUT_TYPE_CONSTANTS.contains(traceTypeId)) {
                        return true;
                    }
                } catch (CoreException e) {
                    // Ignore
                }
            }
        }
    }
    return false;
}