<commit_before>/**
 * Copyright (c) 2014 by Center Open Middleware. All Rights Reserved.
 * Titanium Appcelerator 3.3.0GA
 * Licensed under the terms of the Apache Public License
 * Please see the LICENSE included with this distribution for details.
 *
 */

"use strict";

var instanceManagerView = function (parentWindow, logo, systemLabel, formCallback) {
	var theme = require('ui/style/instanceManagerViewStyle');
	 /* TODO: Change Style names */
		
	var confView, confViewTitle,
		confInstanceContainer, confInstanceContainerTitle,
		confInstanceMainView, confInstanceListView;
	
	var createConfiguration = function createConfiguration() {
		/* Create the main configuration view */
		confView = Ti.UI.createView(theme.view);
		confViewTitle = Ti.UI.createLabel(theme.configurationFormTitle);
		confView.add(confViewTitle);
		
		/* Create a Instance Container View */
		confInstanceContainer = Ti.UI.createView(Yaast.MergeObject(theme.containerView, {
			/* This should be in 'instanceManagerViewStyle' */
			width: parentWindow.getWidth() * 0.9,
			left: '5%',
			height: parentWindow.getHeight() * 0.7,
			bottom: '10%'
			/* TODO: What append if there is a virtual navigationBar, bottom: '5%' doesn't work */
		}));
		confInstanceContainerTitle = Ti.UI.createLabel(theme.instanceTitle);
		confInstanceContainer.add(confInstanceContainerTitle);
		confView.add(confInstanceContainer);

		/* Create Instaces Main View */
		confInstanceMainView = Ti.UI.createView(theme.connectionView);
		confInstanceContainer.add(confInstanceMainView);
		
		/* Create Instances List View */
		confInstanceListView = Ti.UI.createListView();
		confInstanceMainView.add(confInstanceListView);
		var section = []; /* Array of sections */
		/* Private Instances Section */
		var privateSection = Ti.UI.createListSection();
		var headerPrivate = Ti.UI.createView(theme.headerView);
		/* TODO: Adds '+' button to create new instance */
		headerPrivate.add(Ti.UI.createLabel(Yaast.MergeObject(theme.headerViewLabel, {
			text: 'Private'
		})));
		privateSection.setHeaderView(headerPrivate);
		section.push(privateSection);
		/* Public Instances Section */
		var publicSection = Ti.UI.createListSection();
		var headerPublic = Ti.UI.createView(theme.headerView);
		headerPublic.add(Ti.UI.createLabel(Yaast.MergeObject(theme.headerViewLabel, {
			text: 'Public'
		})));
		publicSection.setHeaderView(headerPublic);
		section.push(publicSection),
		/* Apply sections */
		confInstanceListView.sections = section;
		
		/* Adding to parent window */
		parentWindow.add(confView);
	};
	
	var _self = {};
	createConfiguration();
	return _self;
};

module.exports = instanceManagerView;<commit_msg>Add elements to private list<commit_after>/**
 * Copyright (c) 2014 by Center Open Middleware. All Rights Reserved.
 * Titanium Appcelerator 3.3.0GA
 * Licensed under the terms of the Apache Public License
 * Please see the LICENSE included with this distribution for details.
 *
 */

"use strict";

var instanceManagerView = function (parentWindow, logo, systemLabel, formCallback) {
	var theme = require('ui/style/instanceManagerViewStyle');
	 /* TODO: Change Style names */
		
	var confView, confViewTitle,
		confInstanceContainer, confInstanceContainerTitle,
		confInstanceMainView, confInstanceListView;
	
	var createConfiguration = function createConfiguration() {
		/* Create the main configuration view */
		confView = Ti.UI.createView(theme.view);
		confViewTitle = Ti.UI.createLabel(theme.configurationFormTitle);
		confView.add(confViewTitle);
		
		/* Create a Instance Container View */
		confInstanceContainer = Ti.UI.createView(Yaast.MergeObject(theme.containerView, {
			/* This should be in 'instanceManagerViewStyle' */
			width: parentWindow.getWidth() * 0.9,
			left: '5%',
			height: parentWindow.getHeight() * 0.7,
			bottom: '10%'
			/* TODO: What append if there is a virtual navigationBar, bottom: '5%' doesn't work */
		}));
		confInstanceContainerTitle = Ti.UI.createLabel(theme.instanceTitle);
		confInstanceContainer.add(confInstanceContainerTitle);
		confView.add(confInstanceContainer);

		/* Create Instaces Main View */
		confInstanceMainView = Ti.UI.createView(theme.connectionView);
		confInstanceContainer.add(confInstanceMainView);
		
		/* Create Instances List View */
		confInstanceListView = Ti.UI.createListView({
			templates: { /* Define diferentes style templates for items in the list view */
				'template' : theme.connectionListViewTemplate,
				'template_connected' : theme.connectionListViewTemplateConected  /* change for ...Connected */
			},
			defaultItemTemplate: 'template'
		});
		confInstanceMainView.add(confInstanceListView);
		var section = []; /* Array of sections */
		/* Private Instances Section */
		var privateSection = Ti.UI.createListSection();
		var headerPrivate = Ti.UI.createView(theme.headerView);
		/* TODO: Adds '+' button to create new instance */
		headerPrivate.add(Ti.UI.createLabel(Yaast.MergeObject(theme.headerViewLabel, {
			text: 'Private'
		})));
		privateSection.setHeaderView(headerPrivate);
		/* Add predefine instances */
		privateSection.setItems([
			/* TODO: Load info from archive or db */
			{ template: 'template', connection: {text: 'Wirecloud CoNWeT'}, url: {text: 'https://wirecloud.conwet.fi.upm.es/'}, id: {text: '1'} },
		]);
		section.push(privateSection);
		/* Public Instances Section */
		var publicSection = Ti.UI.createListSection();
		var headerPublic = Ti.UI.createView(theme.headerView);
		headerPublic.add(Ti.UI.createLabel(Yaast.MergeObject(theme.headerViewLabel, {
			text: 'Public'
		})));
		publicSection.setHeaderView(headerPublic);
		section.push(publicSection),
		/* Apply sections */
		confInstanceListView.sections = section;
		
		/* Adding to parent window */
		parentWindow.add(confView);
	};
	
	var _self = {};
	createConfiguration();
	return _self;
};

module.exports = instanceManagerView;
{'fraction_non_alphanumeric': 0.1181169272603671, 'fraction_numerical': 0.005268524813052345, 'mean_word_length': 4.6101048617731175, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, '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': '1445077', 'n_tokens_mistral': 1867, 'n_tokens_neox': 1664, 'n_words': 404}