<commit_before>/*
 * Perfclispe
 * 
 * 
 * Copyright (c) 2013 <NAME>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.perfclipse.ui.wizards;

import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;

/**
 * @author <NAME>
 *
 */
public class PropertyPage extends WizardPage {

	private Composite container;
	private Label nameLabel;
	private Text nameText;

	private Label valueLabel;
	private Text valueText;

	public PropertyPage() {
		this("Property");
	}
	
	/**
	 * @param pageName
	 */
	public PropertyPage(String pageName) {
		super(pageName);
	}

	/**
	 * @param pageName
	 * @param title
	 * @param titleImage
	 */
	public PropertyPage(String pageName, String title,
			ImageDescriptor titleImage) {
		super(pageName, title, titleImage);
		// TODO Auto-generated constructor stub
	}

	@Override
	public void createControl(Composite parent) {
		setTitle("Property wizard");
		setDescription("Fill in name and value.");
		container = new Composite(parent, SWT.NONE);
		GridLayout layout = new GridLayout();
		GridData data;
		layout.numColumns = 2;
		container.setLayout(layout);
		
		nameLabel = new Label(container, SWT.NONE);
		nameLabel.setText("Name: ");
		
		nameText = new Text(container, SWT.NONE);
		data = new GridData();
		data.horizontalAlignment = SWT.FILL;
		data.grabExcessHorizontalSpace = true;
		nameText.setLayoutData(data);
		
		
		valueLabel = new Label(container, SWT.NONE);
		valueLabel.setText("Value: ");
		
		valueText = new Text(container, SWT.NONE);
		data = new GridData();
		data.horizontalAlignment = SWT.FILL;
		data.grabExcessHorizontalSpace = true;
		valueText.setLayoutData(data);
		
		setControl(container);
	}

	public Label getNameLabel() {
		return nameLabel;
	}

	public Text getNameText() {
		return nameText;
	}

	public Label getValueLabel() {
		return valueLabel;
	}

	public Text getValueText() {
		return valueText;
	}
	
	

}<commit_msg>Inehrit PropertyPage from AbstractPerfCakePage<commit_after>/*
 * Perfclispe
 * 
 * 
 * Copyright (c) 2013 <NAME>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.perfclipse.ui.wizards;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.perfclipse.model.PropertyModel;

/**
 * @author <NAME>
 *
 */
public class PropertyPage extends AbstractPerfCakePage {

	private static final String PROPERTY_PAGE_NAME = "Property";
	private Composite container;
	private Label nameLabel;
	private Text nameText;

	private Label valueLabel;
	private Text valueText;
	
	private PropertyModel property;

	
	
	public PropertyPage(){
		this(PROPERTY_PAGE_NAME, false);
	}
	
	public PropertyPage(PropertyModel property){
		this(PROPERTY_PAGE_NAME, true);
		this.property = property;
	}
	

	/**
	 * @param pageName
	 * @param edit
	 */
	private PropertyPage(String pageName, boolean edit) {
		super(pageName, edit);
	}

	@Override
	public void createControl(Composite parent) {
		setTitle("Property wizard");
		setDescription("Fill in name and value.");
		container = new Composite(parent, SWT.NONE);
		GridLayout layout = new GridLayout();
		GridData data;
		layout.numColumns = 2;
		container.setLayout(layout);
		
		nameLabel = new Label(container, SWT.NONE);
		nameLabel.setText("Name: ");
		
		nameText = new Text(container, SWT.NONE);
		data = new GridData();
		data.horizontalAlignment = SWT.FILL;
		data.grabExcessHorizontalSpace = true;
		nameText.setLayoutData(data);
		
		
		valueLabel = new Label(container, SWT.NONE);
		valueLabel.setText("Value: ");
		
		valueText = new Text(container, SWT.NONE);
		data = new GridData();
		data.horizontalAlignment = SWT.FILL;
		data.grabExcessHorizontalSpace = true;
		valueText.setLayoutData(data);
		
		setControl(container);
	}

	
	
	@Override
	protected void fillCurrentValues() {
		nameText.setText(property.getProperty().getName());
		valueText.setText(property.getProperty().getValue());
		super.fillCurrentValues();
	}

	public Label getNameLabel() {
		return nameLabel;
	}

	public Text getNameText() {
		return nameText;
	}

	public Label getValueLabel() {
		return valueLabel;
	}

	public Text getValueText() {
		return valueText;
	}
	
	

}
{'fraction_non_alphanumeric': 0.10493273542600896, 'fraction_numerical': 0.003228699551569507, 'mean_word_length': 4.143911439114391, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '7660021', 'n_tokens_mistral': 1830, 'n_tokens_neox': 1659, 'n_words': 476}