Java Code Examples for org.eclipse.core.resources.IFolder#setHidden()

The following examples show how to use org.eclipse.core.resources.IFolder#setHidden() . 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
Source File: TmfProjectModelElement.java    From tracecompass with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * Returns the trace specific supplementary folder under the project's
 * supplementary folder. Its parent folders will be created if they don't exist.
 * If createFolder is true, the returned folder will be created, otherwise it
 * may not exist.
 *
 * @param supplFolderPath
 *            folder path relative to the project's supplementary folder
 * @param createFolder
 *            if true, the returned folder will be created
 * @param progressMonitor
 *            the progress monitor
 * @return the trace specific supplementary folder
 * @since 4.0
 */
public IFolder prepareTraceSupplementaryFolder(String supplFolderPath, boolean createFolder, IProgressMonitor progressMonitor) {
    SubMonitor subMonitor = SubMonitor.convert(progressMonitor);
    IFolder folder = getTraceSupplementaryFolder(supplFolderPath);
    IFolder propertiesFolder = folder.getFolder(TmfCommonConstants.TRACE_PROPERTIES_FOLDER);
    if ((createFolder && propertiesFolder.exists() && propertiesFolder.isHidden()) ||
            (!createFolder && folder.getParent().exists())) {
        return folder;
    }
    try {
        ICoreRunnable runnable = monitor -> {
            if (createFolder) {
                TraceUtils.createFolder(propertiesFolder, monitor);
                propertiesFolder.setHidden(true);
            } else {
                TraceUtils.createFolder((IFolder) folder.getParent(), monitor);
            }
        };
        ResourcesPlugin.getWorkspace().run(runnable, folder.getProject(), IWorkspace.AVOID_UPDATE, subMonitor);
    } catch (CoreException e) {
        Activator.getDefault().logError("Error creating supplementary folder " + folder.getFullPath(), e); //$NON-NLS-1$
    }
    return folder;
}
 
Example 2
Source File: ProjectArtifactHandler.java    From developer-studio with Apache License 2.0 5 votes vote down vote up
protected IFile getTargetArchive(IProject project, String ext) throws Exception {
	String finalName = String.format("%s.%s", project.getName(), ext);
	IFolder binaries = project.getFolder("target");
	if (!binaries.exists()) {
		binaries.create(true, true, getProgressMonitor());
		binaries.setHidden(true);
	}
	IFile archive = project.getFile("target" + File.separator + finalName);
	return archive;
}
 
Example 3
Source File: ProjectArtifactHandler.java    From developer-studio with Apache License 2.0 5 votes vote down vote up
protected IFile getTargetArchive(IProject project, String version, String ext) throws Exception {
	String finalName = String.format("%s.%s", project.getName() + "_" + version, ext);
	IFolder binaries = project.getFolder("target");
	if (!binaries.exists()) {
		binaries.create(true, true, getProgressMonitor());
		binaries.setHidden(true);
	}
	IFile archive = project.getFile("target" + File.separator + finalName);
	return archive;
}
 
Example 4
Source File: TmfCommonProjectElement.java    From tracecompass with Eclipse Public License 2.0 4 votes vote down vote up
private static void hidePropertiesFolder(IFolder supplFolder) throws CoreException {
    IFolder propertiesFolder = supplFolder.getFolder(TmfCommonConstants.TRACE_PROPERTIES_FOLDER);
    if (propertiesFolder.exists()) {
        propertiesFolder.setHidden(true);
    }
}