// Path: si.gos.transpiler.ui/src/si/gos/transpiler/ui/parts/InstallTranspilerPart.java
// public class InstallTranspilerPart extends TableCrudPart {
// 
// 	private TableViewer viewer;
// 
// 	private ITranspilerManager manager = TranspilerPlugin.getDefault().getTranspilerManager();
// 	private InstalledTranspilerController controller = new InstalledTranspilerController();
// 	
// 	public InstallTranspilerPart() {
// 		super(new CrudConfig() {
// 			@Override
// 			public String[] getActionLabels() {
// 				String[] labels = super.getActionLabels(); 
// 				
// 				String[] newLabels = new String[labels.length + 1];
// 				for (int i = 0; i < labels.length; i++) {
// 					newLabels[i] = labels[i];
// 				}
// 				newLabels[3] = "Auto-Detect";
// 				
// 				return newLabels;
// 			}
// 		});
// 	}
// 	
// 	@Override
// 	protected StructuredViewer createStructuredViewer(Composite parent, IWidgetFactory factory) {
// 		viewer = (TableViewer)super.createStructuredViewer(parent, factory);
// 		viewer.setLabelProvider(controller);
// 		viewer.setContentProvider(controller);
// 		viewer.setInput(manager.getInstalledTranspilers());
// 		return viewer;
// 	}
// 	
// 	@Override
// 	protected void handleAdd(IStructuredSelection selection) {
// 		InstalledTranspilerDialog diag = new InstalledTranspilerDialog(getShell());
// 		if (diag.open() == Dialog.OK) {
// 			manager.addInstalledTranspiler(diag.getInstalledTranspiler());
// 			viewer.refresh();
// 		}
// 	}
// 
// 	@Override
// 	protected void handleEdit(IStructuredSelection selection) {
// 		InstalledTranspiler transpiler = (InstalledTranspiler)selection.getFirstElement();
// 		InstalledTranspilerDialog diag = new InstalledTranspilerDialog(getShell(), transpiler);
// 		if (diag.open() == Dialog.OK) {
// 			viewer.refresh();
// 		}
// 	}
// 
// 	@Override
// 	protected void handleRemove(IStructuredSelection selection) {
// 		InstalledTranspiler transpiler = (InstalledTranspiler)selection.getFirstElement();
// 		manager.removeInstalledTranspiler(transpiler);
// 		viewer.refresh();
// 	}
// 	
// 	private void autoDetect() {
// 		for (ITranspiler transpiler : manager.getTranspilers().values()) {
// 			InstalledTranspiler itp = transpiler.autoDetect();
// 			
// 			if (itp != null) {
// 				manager.addInstalledTranspiler(itp);
// 			}
// 		}
// 		viewer.refresh();
// 	}
// 	
// 	@Override
// 	protected void handleAction(PartAction action, int index) {
// 		super.handleAction(action, index);
// 		
// 		// auto-detect
// 		if (index == 3) {
// 			autoDetect();
// 		}
// 	}
// 	
// 	public void save() {
// 		manager.saveInstalledTranspilers();
// 	}
// 	
// }


import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import si.gos.eclipse.widgets.utils.WidgetFactory;
import si.gos.transpiler.ui.parts.InstallTranspilerPart;
package si.gos.transpiler.ui.preferences;



public class TranspilerPage extends PreferencePage implements IWorkbenchPreferencePage {

	private InstallTranspilerPart installerPart;
	
	@Override
	protected Control createContents(Composite parent) {
		
// Path: si.gos.transpiler.ui/src/si/gos/transpiler/ui/parts/InstallTranspilerPart.java
// public class InstallTranspilerPart extends TableCrudPart {
// 
// 	private TableViewer viewer;
// 
// 	private ITranspilerManager manager = TranspilerPlugin.getDefault().getTranspilerManager();
// 	private InstalledTranspilerController controller = new InstalledTranspilerController();
// 	
// 	public InstallTranspilerPart() {
// 		super(new CrudConfig() {
// 			@Override
// 			public String[] getActionLabels() {
// 				String[] labels = super.getActionLabels(); 
// 				
// 				String[] newLabels = new String[labels.length + 1];
// 				for (int i = 0; i < labels.length; i++) {
// 					newLabels[i] = labels[i];
// 				}
// 				newLabels[3] = "Auto-Detect";
// 				
// 				return newLabels;
// 			}
// 		});
// 	}
// 	
// 	@Override
// 	protected StructuredViewer createStructuredViewer(Composite parent, IWidgetFactory factory) {
// 		viewer = (TableViewer)super.createStructuredViewer(parent, factory);
// 		viewer.setLabelProvider(controller);
// 		viewer.setContentProvider(controller);
// 		viewer.setInput(manager.getInstalledTranspilers());
// 		return viewer;
// 	}
// 	
// 	@Override
// 	protected void handleAdd(IStructuredSelection selection) {
// 		InstalledTranspilerDialog diag = new InstalledTranspilerDialog(getShell());
// 		if (diag.open() == Dialog.OK) {
// 			manager.addInstalledTranspiler(diag.getInstalledTranspiler());
// 			viewer.refresh();
// 		}
// 	}
// 
// 	@Override
// 	protected void handleEdit(IStructuredSelection selection) {
// 		InstalledTranspiler transpiler = (InstalledTranspiler)selection.getFirstElement();
// 		InstalledTranspilerDialog diag = new InstalledTranspilerDialog(getShell(), transpiler);
// 		if (diag.open() == Dialog.OK) {
// 			viewer.refresh();
// 		}
// 	}
// 
// 	@Override
// 	protected void handleRemove(IStructuredSelection selection) {
// 		InstalledTranspiler transpiler = (InstalledTranspiler)selection.getFirstElement();
// 		manager.removeInstalledTranspiler(transpiler);
// 		viewer.refresh();
// 	}
// 	
// 	private void autoDetect() {
// 		for (ITranspiler transpiler : manager.getTranspilers().values()) {
// 			InstalledTranspiler itp = transpiler.autoDetect();
// 			
// 			if (itp != null) {
// 				manager.addInstalledTranspiler(itp);
// 			}
// 		}
// 		viewer.refresh();
// 	}
// 	
// 	@Override
// 	protected void handleAction(PartAction action, int index) {
// 		super.handleAction(action, index);
// 		
// 		// auto-detect
// 		if (index == 3) {
// 			autoDetect();
// 		}
// 	}
// 	
// 	public void save() {
// 		manager.saveInstalledTranspilers();
// 	}
// 	
// }


// Path: si.gos.transpiler.ui/src/si/gos/transpiler/ui/preferences/TranspilerPage.java
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import si.gos.eclipse.widgets.utils.WidgetFactory;
import si.gos.transpiler.ui.parts.InstallTranspilerPart;

package si.gos.transpiler.ui.preferences;



public class TranspilerPage extends PreferencePage implements IWorkbenchPreferencePage {

	private InstallTranspilerPart installerPart;
	
	@Override
	protected Control createContents(Composite parent) {
		
		installerPart = new InstallTranspilerPart();