![JAR search and dependency download from the Maven repository](/logo.png)
org.ops4j.pax.carrot.ui.TreeBean Maven / Gradle / Ivy
The newest version!
/*
* Copyright 2013 Harald Wellmann
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied.
*
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.ops4j.pax.carrot.ui;
import java.io.File;
import java.io.Serializable;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.enterprise.context.SessionScoped;
import javax.inject.Inject;
import javax.inject.Named;
import org.richfaces.component.UITree;
import org.richfaces.event.TreeSelectionChangeEvent;
import org.richfaces.model.TreeNode;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @author Harald Wellmann
*
*/
@SessionScoped
@Named
public class TreeBean implements Serializable {
private static final long serialVersionUID = 1L;
private static Logger log = LoggerFactory.getLogger(TreeBean.class);
@Inject
private Settings settings;
private Collection currentSelection;
private FileSystemNode root;
private File selectedFile;
@PostConstruct
public void init() {
String inputRoot = settings.getInputRoot();
root = new FileSystemNode(inputRoot, inputRoot);
}
public List getRoots() {
return Collections.singletonList(root);
}
public void selectionChanged(TreeSelectionChangeEvent event) {
Collection
© 2015 - 2025 Weber Informatics LLC | Privacy Policy