📄 calendarmodelconfigurationimpl.java
字号:
/*--------------------------------------------------------------------------*
| Copyright (C) 2006 Christopher Kohlhaas |
| |
| This program is free software; you can redistribute it and/or modify |
| it under the terms of the GNU General Public License as published by the |
| Free Software Foundation. A copy of the license has been included with |
| these distribution in the COPYING file, if not go to www.fsf.org |
| |
| As a special exception, you are granted the permissions to link this |
| program with every library, which license fulfills the Open Source |
| Definition as published by the Open Source Initiative (OSI). |
*--------------------------------------------------------------------------*/
package org.rapla.entities.configuration.internal;
import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import java.util.Iterator;
import org.rapla.components.util.iterator.IteratorChain;
import org.rapla.entities.EntityNotFoundException;
import org.rapla.entities.RaplaType;
import org.rapla.entities.configuration.CalendarModelConfiguration;
import org.rapla.entities.configuration.RaplaMap;
import org.rapla.entities.dynamictype.ClassificationFilter;
import org.rapla.entities.dynamictype.DynamicType;
import org.rapla.entities.storage.DynamicTypeDependant;
import org.rapla.entities.storage.EntityReferencer;
import org.rapla.entities.storage.EntityResolver;
import org.rapla.entities.storage.RefEntity;
/**
*
* @author ckohlhaas
* @version 1.00.00
* @since 2.03.00
*/
public class CalendarModelConfigurationImpl extends AbstractClassifiableFilter implements CalendarModelConfiguration, Serializable,EntityReferencer, DynamicTypeDependant {
// Don't forget to increase the serialVersionUID when you change the fields
private static final long serialVersionUID = 1;
RaplaMapImpl selected;
String title;
Date startDate;
Date endDate;
Date selectedDate;
String view;
RaplaMapImpl optionMap;
public CalendarModelConfigurationImpl( RaplaMap selected, ClassificationFilter[] filter, String title, Date startDate, Date endDate, Date selectedDate,String view,RaplaMap extensionMap) {
this.view = view;
this.title = title;
this.startDate = startDate;
this.endDate = endDate;
this.selectedDate = selectedDate;
super.setClassificationFilter( filter );
this.selected = (RaplaMapImpl)selected;
if (selected == null)
{
this.selected = new RaplaMapImpl();
}
this.optionMap = (RaplaMapImpl)extensionMap;
if (optionMap == null)
{
this.optionMap= new RaplaMapImpl();
}
}
public void resolveEntities( EntityResolver resolver) throws EntityNotFoundException {
super.resolveEntities( resolver );
selected.resolveEntities( resolver );
optionMap.resolveEntities( resolver );
}
public RaplaType getRaplaType() {
return TYPE;
}
public Date getStartDate() {
return startDate;
}
public Date getEndDate() {
return endDate;
}
public Date getSelectedDate() {
return selectedDate;
}
public String getTitle() {
return title;
}
public String getView() {
return view;
}
public Collection getSelected() {
return selected.values();
}
public RaplaMap getSelectedMap() {
return selected;
}
/**
* @see org.rapla.entities.storage.EntityReferencer#getReferences()
*/
public Iterator getReferences() {
RaplaMapImpl map = (RaplaMapImpl)selected;
return new IteratorChain(super.getReferences(), map.getReferences());
}
/**
* @see org.rapla.entities.storage.EntityReferencer#isRefering(org.rapla.entities.storage.RefEntity)
*/
public boolean isRefering(RefEntity object) {
RaplaMapImpl map = (RaplaMapImpl)selected;
if ( map.isRefering( object ) )
return true;
if ( super.isRefering(object)) {
return true;
}
return false;
}
public boolean needsChange(DynamicType type) {
if ( super.needsChange( type ))
return true;
return selected.needsChange( type );
}
public void commitChange(DynamicType type) {
super.commitChange( type );
selected.commitChange( type );
}
public RaplaMap getOptionMap()
{
return optionMap;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -