<commit_before>var TreeNodeFace = function(objectId, className){
	this.objectId = objectId;
	this.className = className;
	this.objectDivId = mw3._getObjectDivId(this.objectId);
	this.objectDiv = $('#' + this.objectDivId);
	this.nodeDiv = this.objectDiv.children('div');
	
	this.object = mw3.objects[this.objectId];

	debugger;

	if(this.object == null)
		return true;

	var metadata = mw3.getMetadata(this.className);
	
	if(metadata.childrenFieldDescriptor)
		this.childFieldName = metadata.childrenFieldDescriptor.name;

	this.containerFieldName = metadata.getFieldNameForFieldDescriptorType('container');
	if(this.containerFieldName){
		if(this.object[this.containerFieldName]){
			if(this.childFieldName && this.object[this.childFieldName] != null)
				this.expanded = true;

			if(this.expanded)
				this.nodeDiv.addClass('minlast');
			else
				this.nodeDiv.addClass('plus');
		}

		$(this.nodeDiv).bind('dblclick', {objectId : this.objectId}, function(event){
			mw3.getFaceHelper(event.data.objectId).action();
		});
	}
	
	if(metadata.serviceMethodContexts){
		for(var i=0; i<metadata.serviceMethodContexts.length; i++){
			var servceMethodContext = metadata.serviceMethodContexts[i];
			
			if(servceMethodContext.childrenLoader)
				this.childrenLoaderMethodName = servceMethodContext.methodName;
		}
	}
	
	if(this.objectDiv.hasClass('filemgr-tree'))
		this.nodeDiv.addClass('root');
	
	// add event mouse click
	$(this.nodeDiv).bind('click', {objectId : this.objectId}, function(event){
		mw3.getFaceHelper(event.data.objectId).select();
	});
}

TreeNodeFace.prototype = {
	destroy : function() {
		$(this.nodeDiv).unbind('click').unbind('dblclick');
	},
	startLoading : function(){
		
	},
	
	endLoading : function(){
		this.nodeDiv.removeClass('loading');		
	},
	
	showStatus : function(message){
		if(this.childrenLoaderMethodName + ' DONE.' == message){
			this.nodeDiv.addClass('minlast');
			this.nodeDiv.removeClass('min');

			if(this.object[this.childFieldName] == null || this.object[this.childFieldName].length == 0)
				this.nodeDiv.removeClass('minlast');
			
			var tree = this.getTree();

			tree.trigger('expanded');
		}
	},
	
	getTree : function(){
		var tree = this.objectDiv;
		
		if(!this.objectDiv.hasClass('filemgr-tree'))
			tree = tree.parentsUntil('.filemgr-tree').parent('.filemgr-tree');
		
		return tree;
	},
	
	select : function(){
		if(event.stopPropagation){
			event.stopPropagation();
		}else if(window.event){
			window.event.cancelBubble = true;
		}

		var tree = this.getTree();
		
		if(!this.nodeDiv.hasClass('selected'))
			tree.trigger('change', [this.objectId]);
		
		
		tree.find('.item-fix.selected').removeClass('selected');
		this.nodeDiv.addClass('selected');
	},
	
	expand : function(){
		this.expanded = true;
		
		if(this.nodeDiv.hasClass('pluslast')){
			this.nodeDiv.removeClass('pluslast');
			this.nodeDiv.addClass('minlast');
			
			this.objectDiv.children('u').show();
		}else if(this.nodeDiv.hasClass('plus')){
			this.nodeDiv.removeClass('plus');
			this.nodeDiv.addClass('min');

			if(this.childrenLoaderMethodName && this.childFieldName){
				this.nodeDiv.addClass('loading');
				
				mw3.call(this.objectId, this.childrenLoaderMethodName);
			}
		}
	},
	
	collapse : function(){
		if(this.nodeDiv.hasClass('minlast')){
			this.nodeDiv.removeClass('minlast');
			this.nodeDiv.addClass('pluslast');
		}else if(this.nodeDiv.hasClass('min')){
			this.nodeDiv.removeClass('min');
			this.nodeDiv.addClass('plus');
		}
		
		this.expanded = false;
		this.objectDiv.children('u').hide();
		
		var tree = this.getTree();
		
		tree.trigger('collapsed', [this.objectId]);
	},
	
	action : function(){
		if(event.stopPropagation){
			event.stopPropagation();
		}else if(window.event){
			window.event.cancelBubble = true;
		}

		this.select();

		if(this.object.metaworksContext.when == "MoveTo"){
			mw3.call(this.objectId, 'select');
			return;
		}

		if(this.expanded)
			this.collapse();
		else
			this.expand();
	},
	
	draggable : function(command){
		this.objectDiv.find('.label-content:first').draggable({
			appendTo: "body",
			helper: function( event ) {
				return $('<div>').addClass('filemgr-tree').append($('<div>').addClass('item').append($(this).clone()));
			},
			zIndex: 100,
			start: function(event, ui) {
				eval(command);
			},
			drag: function() {
			},
			stop: function() {
			}
		});
	}
}<commit_msg>EditorPanel에 있는 버튼을 클릭시 Navigator를 Refresh.<commit_after>var TreeNodeFace = function(objectId, className){
	this.objectId = objectId;
	this.className = className;
	this.objectDivId = mw3._getObjectDivId(this.objectId);
	this.objectDiv = $('#' + this.objectDivId);
	this.nodeDiv = this.objectDiv.children('div');
	
	this.object = mw3.objects[this.objectId];

	if(this.object == null)
		return true;

	var metadata = mw3.getMetadata(this.className);
	
	if(metadata.childrenFieldDescriptor)
		this.childFieldName = metadata.childrenFieldDescriptor.name;

	this.containerFieldName = metadata.getFieldNameForFieldDescriptorType('container');
	if(this.containerFieldName){
		if(this.object[this.containerFieldName]){
			if(this.childFieldName && this.object[this.childFieldName] != null)
				this.expanded = true;

			if(this.expanded)
				this.nodeDiv.addClass('minlast');
			else
				this.nodeDiv.addClass('plus');
		}

		$(this.nodeDiv).bind('dblclick', {objectId : this.objectId}, function(event){
			mw3.getFaceHelper(event.data.objectId).action();
		});
	}
	
	if(metadata.serviceMethodContexts){
		for(var i=0; i<metadata.serviceMethodContexts.length; i++){
			var servceMethodContext = metadata.serviceMethodContexts[i];
			
			if(servceMethodContext.childrenLoader)
				this.childrenLoaderMethodName = servceMethodContext.methodName;
		}
	}
	
	if(this.objectDiv.hasClass('filemgr-tree'))
		this.nodeDiv.addClass('root');
	
	// add event mouse click
	$(this.nodeDiv).bind('click', {objectId : this.objectId}, function(event){
		mw3.getFaceHelper(event.data.objectId).select();
	});
}

TreeNodeFace.prototype = {
	destroy : function() {
		$(this.nodeDiv).unbind('click').unbind('dblclick');
	},
	startLoading : function(){
		
	},
	
	endLoading : function(){
		this.nodeDiv.removeClass('loading');		
	},
	
	showStatus : function(message){
		if(this.childrenLoaderMethodName + ' DONE.' == message){
			this.nodeDiv.addClass('minlast');
			this.nodeDiv.removeClass('min');

			if(this.object[this.childFieldName] == null || this.object[this.childFieldName].length == 0)
				this.nodeDiv.removeClass('minlast');
			
			var tree = this.getTree();

			tree.trigger('expanded');
		}
	},
	
	getTree : function(){
		var tree = this.objectDiv;
		
		if(!this.objectDiv.hasClass('filemgr-tree'))
			tree = tree.parentsUntil('.filemgr-tree').parent('.filemgr-tree');
		
		return tree;
	},
	
	select : function(){
		if(event.stopPropagation){
			event.stopPropagation();
		}else if(window.event){
			window.event.cancelBubble = true;
		}

		var tree = this.getTree();
		
		if(!this.nodeDiv.hasClass('selected'))
			tree.trigger('change', [this.objectId]);
		
		
		tree.find('.item-fix.selected').removeClass('selected');
		this.nodeDiv.addClass('selected');
	},
	
	expand : function(){
		this.expanded = true;
		
		if(this.nodeDiv.hasClass('pluslast')){
			this.nodeDiv.removeClass('pluslast');
			this.nodeDiv.addClass('minlast');
			
			this.objectDiv.children('u').show();
		}else if(this.nodeDiv.hasClass('plus')){
			this.nodeDiv.removeClass('plus');
			this.nodeDiv.addClass('min');

			if(this.childrenLoaderMethodName && this.childFieldName){
				this.nodeDiv.addClass('loading');
				
				mw3.call(this.objectId, this.childrenLoaderMethodName);
			}
		}
	},
	
	collapse : function(){
		if(this.nodeDiv.hasClass('minlast')){
			this.nodeDiv.removeClass('minlast');
			this.nodeDiv.addClass('pluslast');
		}else if(this.nodeDiv.hasClass('min')){
			this.nodeDiv.removeClass('min');
			this.nodeDiv.addClass('plus');
		}
		
		this.expanded = false;
		this.objectDiv.children('u').hide();
		
		var tree = this.getTree();
		
		tree.trigger('collapsed', [this.objectId]);
	},
	
	action : function(){
		if(event.stopPropagation){
			event.stopPropagation();
		}else if(window.event){
			window.event.cancelBubble = true;
		}

		this.select();

		if(this.object.metaworksContext.when == "MoveTo"){
			mw3.call(this.objectId, 'open');
			return;
		}

		if(this.expanded)
			this.collapse();
		else
			this.expand();
	},
	
	draggable : function(command){
		this.objectDiv.find('.label-content:first').draggable({
			appendTo: "body",
			helper: function( event ) {
				return $('<div>').addClass('filemgr-tree').append($('<div>').addClass('item').append($(this).clone()));
			},
			zIndex: 100,
			start: function(event, ui) {
				eval(command);
			},
			drag: function() {
			},
			stop: function() {
			}
		});
	}
}
{'fraction_non_alphanumeric': 0.17364588074647247, 'fraction_numerical': 0.0027309968138370506, 'mean_word_length': 4.269184652278177, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6644321', 'n_tokens_mistral': 3387, 'n_tokens_neox': 2931, 'n_words': 384}