<commit_before>/**
 * 
 */
package javamm.ui.wizard.file;

import java.io.ByteArrayInputStream;
import java.lang.reflect.InvocationTargetException;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.ui.wizards.NewTypeWizardPage;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.WorkspaceModifyOperation;
import org.eclipse.ui.views.contentoutline.ContentOutline;
import org.eclipse.xtext.ui.editor.XtextEditor;
import org.eclipse.xtext.ui.editor.model.IXtextDocument;

/**
 * @author <NAME>
 *
 */
public class NewJavammFileWizardPage extends NewTypeWizardPage {
	
	public static final String JAVAMM_FILE = "Javamm File";

	protected static final int COLS = 4;
	
	private IResource resource;

	public NewJavammFileWizardPage() {
		super(true, JAVAMM_FILE);
		this.setTitle(JAVAMM_FILE);
		this.setDescription("Creates a new Java-- file in the current project");
	}
	
	public IResource getResource() {
		return resource;
	}

	protected void setResource(IResource resource) {
		this.resource = resource;
	}

	protected Composite createCommonControls(Composite parent) {
		initializeDialogUnits(parent);
		Composite composite = new Composite(parent, SWT.NONE);
		composite.setFont(parent.getFont());
		GridLayout layout = new GridLayout();
		layout.numColumns = COLS;
		composite.setLayout(layout);
		createContainerControls(composite, COLS);
		createPackageControls(composite, COLS);
		createSeparator(composite, COLS);
		createTypeNameControls(composite, COLS);
		return composite;
	}

	@Override
	public void createControl(Composite parent) {
		Composite composite = createCommonControls(parent);
		createSuperClassControls(composite, COLS);
		createSuperInterfacesControls(composite, COLS);
		setControl(composite);
	}
	
	protected void init(IStructuredSelection selection) {
		IJavaElement elem = getSelectedResource(selection);
		initContainerPage(elem);
		initTypePage(elem);
	}
	
	public IJavaElement getSelectedResource(IStructuredSelection selection) {<commit_msg>don't show superclass and superinterfaces in the wizard<commit_after>/**
 * 
 */
package javamm.ui.wizard.file;

import java.io.ByteArrayInputStream;
import java.lang.reflect.InvocationTargetException;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.ui.wizards.NewTypeWizardPage;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.WorkspaceModifyOperation;
import org.eclipse.ui.views.contentoutline.ContentOutline;
import org.eclipse.xtext.ui.editor.XtextEditor;
import org.eclipse.xtext.ui.editor.model.IXtextDocument;

/**
 * @author <NAME>
 *
 */
public class NewJavammFileWizardPage extends NewTypeWizardPage {
	
	public static final String JAVAMM_FILE = "Javamm File";

	protected static final int COLS = 4;
	
	private IResource resource;

	public NewJavammFileWizardPage() {
		super(true, JAVAMM_FILE);
		this.setTitle(JAVAMM_FILE);
		this.setDescription("Creates a new Java-- file in the current project");
	}
	
	public IResource getResource() {
		return resource;
	}

	protected void setResource(IResource resource) {
		this.resource = resource;
	}

	protected Composite createCommonControls(Composite parent) {
		initializeDialogUnits(parent);
		Composite composite = new Composite(parent, SWT.NONE);
		composite.setFont(parent.getFont());
		GridLayout layout = new GridLayout();
		layout.numColumns = COLS;
		composite.setLayout(layout);
		createContainerControls(composite, COLS);
		createPackageControls(composite, COLS);
		createSeparator(composite, COLS);
		createTypeNameControls(composite, COLS);
		return composite;
	}

	@Override
	public void createControl(Composite parent) {
		Composite composite = createCommonControls(parent);
//		createSuperClassControls(composite, COLS);
//		createSuperInterfacesControls(composite, COLS);
		setControl(composite);
	}
	
	protected void init(IStructuredSelection selection) {
		IJavaElement elem = getSelectedResource(selection);
		initContainerPage(elem);
		initTypePage(elem);
	}
	
	public IJavaElement getSelectedResource(IStructuredSelection selection) {
{'fraction_non_alphanumeric': 0.1003361344537815, 'fraction_numerical': 0.0003361344537815126, 'mean_word_length': 6.08452380952381, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1791842', 'n_tokens_mistral': 1906, 'n_tokens_neox': 1815, 'n_words': 337}