<commit_before>package org.xtuml.bp.core.ui.preferences;
//====================================================================
//
//File:      BridgePointProjectReferencesPreferences.java
//
//(c) Copyright 2003-2014 Mentor Graphics Corporation  All rights reserved.
//
//====================================================================
//

import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ProjectScope;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.preferences.IScopeContext;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Group;
import org.osgi.service.prefs.BackingStoreException;
import org.osgi.service.prefs.Preferences;

import org.xtuml.bp.core.CorePlugin;
import org.xtuml.bp.core.SystemModel_c;
import org.xtuml.bp.core.common.BridgePointPreferencesStore;
import org.xtuml.bp.core.ui.Selection;

public class BridgePointProjectReferencesPreferences extends
		BridgePointProjectPreferences {
	
	// These id strings must remain the same, otherwise previously set preferences
	// will not be honored
	// For any future id strings do NOT include the full plug-in name
	public final static String BP_PROJECT_REFERENCES_ID = "com.mentor.nucleus.bp.ui.project.references"; //$NON-NLS-1$
	public final static String BP_PROJECT_CLASS_REFERENCES_ID = "bp.project.class_references"; //$NON-NLS-1$
	public final static String BP_PROJECT_EMITRTODATA_ID = "com.mentor.nucleus.bp.ui.project.emitRTOData"; //$NON-NLS-1$
	
	private Button allowInterProjectReferences;
	private Button allowIPRClasses;
	private Button emitRTOData;

	public BridgePointProjectReferencesPreferences(Preferences projectNode) {
		super(projectNode);
	}

	@Override
	protected Control createContents(Composite parent) {
		// create the composite to hold the widgets
		Composite composite = new Composite(parent, SWT.NULL);

		// create the desired layout for this wizard page
		GridLayout gl = new GridLayout();
		int ncol = 1;
		gl.numColumns = ncol;
		gl.horizontalSpacing = 10;
		gl.verticalSpacing = 10;
		composite.setLayout(gl);

		GridData data = new GridData(GridData.FILL_HORIZONTAL);
		data.grabExcessHorizontalSpace = true;
		data.horizontalIndent = -1;

	    Group iprUsageGroup = new Group(composite, SWT.None);
	    iprUsageGroup.setText("IPR Usage");
	    iprUsageGroup.setLayout(new GridLayout(2, false));
	    GridData iprUsageGroupData = new GridData(GridData.FILL_HORIZONTAL);
	    iprUsageGroup.setLayoutData(iprUsageGroupData);
		
		allowInterProjectReferences = new Button(iprUsageGroup, SWT.CHECK
				| SWT.LEFT);
		allowInterProjectReferences
				.setText("Allow inter-project model references");
		allowInterProjectReferences.setLayoutData(new GridData());
		allowInterProjectReferences.setEnabled(true);

		allowIPRClasses = new Button(
				iprUsageGroup, SWT.CHECK | SWT.LEFT);
		allowIPRClasses
				.setText("Allow class access via IPR");
		GridData childData = new GridData();
		childData.horizontalIndent = 20;
		childData.horizontalSpan = 2;
		allowIPRClasses.setLayoutData(childData);
		allowIPRClasses.setEnabled(true);
		
		allowInterProjectReferences.addSelectionListener(new SelectionAdapter() {
			@Override
			public void widgetSelected(SelectionEvent e) {
				// if this button is deselected, deselect the class button
				if (!allowInterProjectReferences.getSelection()) {
					allowIPRClasses.setSelection(false);
				}
			}
		});
		allowIPRClasses.addSelectionListener(new SelectionAdapter() {
			@Override
			public void widgetSelected(SelectionEvent e) {
				// If this button is checked, the main IPR button must be checked<commit_msg>job #8061 - add new project preference checkbox.<commit_after>package org.xtuml.bp.core.ui.preferences;
//====================================================================
//
//File:      BridgePointProjectReferencesPreferences.java
//
//(c) Copyright 2003-2014 Mentor Graphics Corporation  All rights reserved.
//
//====================================================================
//

import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ProjectScope;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.preferences.IScopeContext;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Group;
import org.osgi.service.prefs.BackingStoreException;
import org.osgi.service.prefs.Preferences;

import org.xtuml.bp.core.CorePlugin;
import org.xtuml.bp.core.SystemModel_c;
import org.xtuml.bp.core.common.BridgePointPreferencesStore;
import org.xtuml.bp.core.ui.Selection;

public class BridgePointProjectReferencesPreferences extends
		BridgePointProjectPreferences {
	
	// These id strings must remain the same, otherwise previously set preferences
	// will not be honored
	// For any future id strings do NOT include the full plug-in name
	public final static String BP_PROJECT_REFERENCES_ID = "com.mentor.nucleus.bp.ui.project.references"; //$NON-NLS-1$
	public final static String BP_PROJECT_CLASS_REFERENCES_ID = "bp.project.class_references"; //$NON-NLS-1$
	public final static String BP_PROJECT_EMITRTODATA_ID = "com.mentor.nucleus.bp.ui.project.emitRTOData"; //$NON-NLS-1$
	
	private Button allowInterProjectReferences;
	private Button allowIPRClasses;
	private Button emitRTOData;

	public BridgePointProjectReferencesPreferences(Preferences projectNode) {
		super(projectNode);
	}

	@Override
	protected Control createContents(Composite parent) {
		// create the composite to hold the widgets
		Composite composite = new Composite(parent, SWT.NULL);

		// create the desired layout for this wizard page
		GridLayout gl = new GridLayout();
		int ncol = 1;
		gl.numColumns = ncol;
		gl.horizontalSpacing = 10;
		gl.verticalSpacing = 10;
		composite.setLayout(gl);

		GridData data = new GridData(GridData.FILL_HORIZONTAL);
		data.grabExcessHorizontalSpace = true;
		data.horizontalIndent = -1;

	    Group iprUsageGroup = new Group(composite, SWT.None);
	    iprUsageGroup.setText("IPR Usage");
	    iprUsageGroup.setLayout(new GridLayout(2, false));
	    GridData iprUsageGroupData = new GridData(GridData.FILL_HORIZONTAL);
	    iprUsageGroup.setLayoutData(iprUsageGroupData);
		
		allowInterProjectReferences = new Button(iprUsageGroup, SWT.CHECK
				| SWT.LEFT);
		allowInterProjectReferences
				.setText("Allow inter-project model references");
		allowInterProjectReferences.setLayoutData(new GridData());
		allowInterProjectReferences.setEnabled(true);

		allowIPRClasses = new Button(
				iprUsageGroup, SWT.CHECK | SWT.LEFT);
		allowIPRClasses
				.setText("Allow class and function access via IPR");
		GridData childData = new GridData();
		childData.horizontalIndent = 20;
		childData.horizontalSpan = 2;
		allowIPRClasses.setLayoutData(childData);
		allowIPRClasses.setEnabled(true);
		
		allowInterProjectReferences.addSelectionListener(new SelectionAdapter() {
			@Override
			public void widgetSelected(SelectionEvent e) {
				// if this button is deselected, deselect the class button
				if (!allowInterProjectReferences.getSelection()) {
					allowIPRClasses.setSelection(false);
				}
			}
		});
		allowIPRClasses.addSelectionListener(new SelectionAdapter() {
			@Override
			public void widgetSelected(SelectionEvent e) {
				// If this button is checked, the main IPR button must be checked
{'fraction_non_alphanumeric': 0.12515382722126508, 'fraction_numerical': 0.005660841742554762, 'mean_word_length': 5.156818181818182, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6821976', 'n_tokens_mistral': 2643, 'n_tokens_neox': 2365, 'n_words': 519}