_jsc_package(["com","coremedia","easyedit"]);









(function(){















var $=com.coremedia.easyedit.ContextInfo=com_coremedia_easyedit_ContextInfo=function(currentWindow,id,
resourceId,containerId,docposition,property,
eventTypeName,uri,position,hoverEffect,
groupId)
{

if(typeof(eventTypeName)!="undefined"&&eventTypeName!=null){
var eve=com.coremedia.editing.ComponentEventType.getEventTypeByName(eventTypeName);
if(eve==undefined)alert("Javascript event of name="+eventTypeName+" is undefined. Check your templates.");
else{
var processMethodName=eve.getProcessMethodName();
this[processMethodName]=this._processEvent;
}
}

this.super$com$coremedia$editing$AbstractButton(currentWindow,id,"");

this._resourceId=this.defaultToNull(resourceId);
this._containerId=this.defaultToNull(containerId);
this._docposition=this.defaultToNull(docposition);
this._property=this.defaultToNull(property);
this._uri=uri;
this._position=position;
this._hoverEffect=hoverEffect;
this._groupId=this.defaultToNull(groupId);
if(this._groupId!=null){
var group=this.getGroup();
group.addMemberId(id);
}
};$.constructorname='com.coremedia.easyedit.ContextInfo';$.superconstructor=com.coremedia.editing.AbstractButton;$=$.prototype=new com.coremedia.editing.AbstractButton();$.super$com$coremedia$editing$AbstractButton=com.coremedia.editing.AbstractButton;$.constructor=com.coremedia.easyedit.ContextInfo;

$.getGroup=function(){
if(this._groupId)
return com.coremedia.easyedit.ContextInfoGroup.getGroup(this._groupId);
else
return null;
};

$.defaultToNull=function(x){
if(typeof x=="undefined")return null;
return x;
};

$.getPreviewPane=function(){
return this.getFrame().getParent();
};

$.addParam=function(uri,key,value){
if(value==null)return uri;
var separator=uri.indexOf("?")<0?"?":"&";
return uri+separator+key+"="+value;
};

$.addParams=function(uri){
var docPosition=this.getDocPosition();
uri=this.addParam(uri,"docPosition",docPosition);
var property=this.getProperty();
uri=this.addParam(uri,"property",property);
var containerId=this.getContainerId();
uri=this.addParam(uri,"containerId",containerId);
var resourceId=this.getResourceId();
uri=this.addParam(uri,"contentId",resourceId);

return uri;
};

$.getUri=function(){
if(this._uri)return this.addParams(this._uri);
var previewPane=this.getPreviewPane();
if(typeof(previewPane)!="undefined")
return previewPane.getPopupUrl(this);
return null;
};




$.getPosition=function(){
return this._position;
};

$.getHighlightStyleClass=function(){
return this._highlightStyleClass;
};

$._processEvent=function(event){
if(this.isPressed()){
this.deactivate();
}else{
this.activate();

var popup=this.getPopup();
popup.setParent(this);
popup.setUri(this.getUri());
popup.show(event);
}
event.preventDefault();
return true;
};

$.getPopup=function(){

return com.coremedia.editing.InternalFrame.getInstance(this.getWindow());
};$.super$com$coremedia$editing$AbstractButton$activate=$.activate;

$.activate=function(){
this.super$com$coremedia$editing$AbstractButton$activate();
this.press();

};$.super$com$coremedia$editing$AbstractButton$deactivate=$.deactivate;

$.deactivate=function(){
this.super$com$coremedia$editing$AbstractButton$deactivate();
this.getPopup().hide();
};

$.processClick=function(event){
this.deactivate();
};

$.getParentContextInfo=function(){
var parentContextInfo=this;
do{
parentContextInfo=parentContextInfo.getParent();
}while(parentContextInfo&&parentContextInfo.constructor!=this.constructor);
return parentContextInfo;
};

$._getInherited=function(propertyName){
var contextInfo=this;
do{
var value=contextInfo[propertyName];
if(typeof value!="undefined"&&value!=null){
return value;
}
contextInfo=contextInfo.getParentContextInfo();
}while(contextInfo!=null);
return null;
};




$.getDocPosition=function(){
return this._getInherited("_docposition");
};




$.getProperty=function(){
return this._getInherited("_property");
};




$.getContainerId=function(){
return this._getInherited("_containerId");
};

$.getResourceId=function(){
return this._resourceId;
};


$.performCommand=function(event,command){
if(command){
command.execute();

}
this.deactivate();
};

$.isTransparencyAllowed=function(){
return false;
};$.super$com$coremedia$editing$AbstractButton$_setHover=$._setHover;

$._setHover=
function(h){
if(this._hoverEffect){
if(this._groupId){
var group=this.getGroup();
var frame=com.coremedia.editing.Frame.getInstance(window);
for(var mid in group.getMemberIds()){
var contextInfo=frame.getComponentById(mid);
contextInfo._setHoverSingle(h);
}
}else{
this._setHoverSingle(h);
}
}
};

$._setHoverSingle=function(h){
this.super$com$coremedia$editing$AbstractButton$_setHover(h);
};












})();
_jsc_package(["com","coremedia","easyedit"]);

(function(){

var $=com.coremedia.easyedit.ContextInfoCommand=com_coremedia_easyedit_ContextInfoCommand=function(execute,props){
this._execute=execute;
this.super$com$coremedia$editing$Command(props);
};$.constructorname='com.coremedia.easyedit.ContextInfoCommand';$.superconstructor=com.coremedia.editing.Command;$=$.prototype=new com.coremedia.editing.Command();$.super$com$coremedia$editing$Command=com.coremedia.editing.Command;$.constructor=com.coremedia.easyedit.ContextInfoCommand;

$.execute=function(component){
if(typeof this._execute=="function"){
component=com.coremedia.easyedit.ContextInfoCommand.getContextInfo(component);
if(component)
return this._execute(component);
}
};

com.coremedia.easyedit.ContextInfoCommand.getContextInfo=function(component){
do{component=component.getParent();}
while(component&&(component.constructor!=com.coremedia.easyedit.ContextInfo));
return component;
};




})();
_jsc_package(["com","coremedia","easyedit"]);

(function(){

var $=com.coremedia.easyedit.ContextInfoGroup=com_coremedia_easyedit_ContextInfoGroup=function(id){
this._id=id;
this._members=new Object();
};$.constructorname='com.coremedia.easyedit.ContextInfoGroup';$.superconstructor=Object;$=$.prototype=new Object();$.super$Object=Object;$.constructor=com.coremedia.easyedit.ContextInfoGroup;

com.coremedia.easyedit.ContextInfoGroup.getGroup=function(groupId){
var group=this._groups[groupId];
if(typeof group=="undefined"){
group=new com.coremedia.easyedit.ContextInfoGroup(groupId);
this._groups[groupId]=group;
}
return group;
};

$.addMemberId=
function(memberId){
this._members[memberId]=true;
};




$.getMemberIds=
function(){
return this._members;
};

$.toString=function(){
return"ContextInfoGroup["+id+"]";
};

com.coremedia.easyedit.ContextInfoGroup._groups=new Object();




})();