use of org.eclipse.che.ide.api.resources.Resource in project che by eclipse.
the class ConvertFolderToProjectAction method actionPerformed.
@Override
public void actionPerformed(ActionEvent event) {
Resource folder = getSelectedItem();
if (folder == null) {
return;
}
Path location = folder.getLocation();
if (location == null) {
return;
}
MutableProjectConfig mutableProjectConfig = new MutableProjectConfig();
mutableProjectConfig.setPath(location.toString());
mutableProjectConfig.setName(folder.getName());
projectConfigWizard.show(mutableProjectConfig);
}
use of org.eclipse.che.ide.api.resources.Resource in project che by eclipse.
the class DownloadProjectAction method actionPerformed.
/** {@inheritDoc} */
@Override
public void actionPerformed(ActionEvent e) {
final Resource resource = appContext.getResource();
if (resource == null || resource.getResourceType() != PROJECT) {
return;
}
final Project project = (Project) resource;
downloadContainer.setUrl(project.getURL());
}
use of org.eclipse.che.ide.api.resources.Resource in project che by eclipse.
the class FullTextSearchAction method actionPerformed.
/** {@inheritDoc} */
@Override
public void actionPerformed(ActionEvent e) {
final Resource[] resources = appContext.getResources();
final Path searchPath;
if (resources == null || resources.length == 0 || resources.length > 1) {
searchPath = Path.ROOT;
} else {
if (resources[0] instanceof Container) {
searchPath = resources[0].getLocation();
} else {
final Container parent = resources[0].getParent();
searchPath = parent != null ? parent.getLocation() : Path.ROOT;
}
}
presenter.showDialog(searchPath);
}
use of org.eclipse.che.ide.api.resources.Resource in project che by eclipse.
the class ProjectConfigurationAction method actionPerformed.
@Override
public void actionPerformed(ActionEvent e) {
final Resource[] resources = appContext.getResources();
checkState(resources != null && resources.length == 1);
final Resource resource = resources[0];
checkState(resource instanceof Container);
if (resource.getResourceType() == PROJECT) {
final MutableProjectConfig config = new MutableProjectConfig((Project) resource);
projectWizard.show(config);
}
}
use of org.eclipse.che.ide.api.resources.Resource in project che by eclipse.
the class RefreshPathAction method actionPerformed.
@Override
public void actionPerformed(ActionEvent e) {
final Resource[] resources = appContext.getResources();
if (resources == null || resources.length != 1) {
return;
}
final Resource resource = resources[0];
if (resource instanceof Container) {
((Container) resource).synchronize();
} else {
final Container parent = resource.getParent();
if (parent != null) {
parent.synchronize();
}
}
}
Aggregations