package com.ecep.contract.vm;

import com.ecep.contract.model.Project;
import com.ecep.contract.model.ProjectFile;

import javafx.beans.property.SimpleObjectProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = false)
public class ProjectFileViewModel extends IdentityViewModel<ProjectFile> implements ProjectBasedViewModel {
    /**
     * 关联的项目
     */
    private SimpleObjectProperty<Project> project = new SimpleObjectProperty<>();

    public static ProjectFileViewModel from(ProjectFile file) {
        ProjectFileViewModel viewModel = new ProjectFileViewModel();
        viewModel.update(file);
        return viewModel;
    }
}
