package org.tizen.rt.ide.build;
-import java.util.ArrayList;
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
-import org.eclipse.jface.layout.TableColumnLayout;
import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.ColumnPixelData;
-import org.eclipse.jface.viewers.ColumnWeightData;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TableViewerColumn;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Image;
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.Shell;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.ui.PlatformUI;
import org.tizen.rt.ide.RtosCommandManager;
+import org.tizen.rt.ide.util.WorkspaceUtil;
/**
* DeviceGuideDialogPage Select Emulator Wizard Feature
Composite composite = new Composite(parentComposite, SWT.NONE);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- composite.setLayout(new GridLayout(1, false));
GridData gridData = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL);
gridData.minimumHeight = 0;
composite.setLayoutData(gridData);
-
- TableColumnLayout layout = new TableColumnLayout();
- composite.setLayout(layout);
+ composite.setLayout(new GridLayout(1, false));
tableViewer = new TableViewer(composite, SWT.BORDER | SWT.FULL_SELECTION);
tableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
});
table = tableViewer.getTable();
+ table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
table.setHeaderVisible(true);
table.setLinesVisible(true);
-
- TableViewerColumn tableViewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
- TableColumn tblclmnPixel100 = tableViewerColumn.getColumn();
- layout.setColumnData(tblclmnPixel100, new ColumnPixelData(500, true, true));
- // tblclmnPixel100.setText("Name");
- tblclmnPixel100.setText("Build Options");
-
- // TableViewerColumn tableViewerColumn_1 = new TableViewerColumn(tableViewer, SWT.NONE);
- // TableColumn tblclmnWeight2 = tableViewerColumn_1.getColumn();
- // //Specify width using weights
- // layout.setColumnData(tblclmnWeight2, new ColumnWeightData(2,
- // ColumnWeightData.MINIMUM_WIDTH, true));
- // //tblclmnWeight2.setText("Resolution");
- // tblclmnWeight2.setText(AutoEmulMessages.SELECT_EMULATOR_ITEM_RESULUTION);
- //
- // TableViewerColumn tableViewerColumn_2 = new TableViewerColumn(tableViewer, SWT.NONE);
- // TableColumn tblclmnWeight4 = tableViewerColumn_2.getColumn();
- // //Specify width using weights
- // layout.setColumnData(tblclmnWeight4, new ColumnWeightData(4,
- // ColumnWeightData.MINIMUM_WIDTH, true));
- // //TODO: column.setText(resources.getString("View.Table.Column.AutoEmul"));
- // tblclmnWeight4.setText(AutoEmulMessages.SELECT_EMULATOR_ITEM_STATUS);
+
+ TableColumn tblclmnNewColumn = new TableColumn(table, SWT.NONE);
+ tblclmnNewColumn.setWidth(500);
+ tblclmnNewColumn.setText("Build Options");
+
+ Composite composite_1 = new Composite(composite, SWT.NONE);
+ composite_1.setLayout(new GridLayout(2, false));
+
+ Button btnNewButton = new Button(composite_1, SWT.NONE);
+ btnNewButton.setEnabled(false);
+ btnNewButton.setText("Toolchain Select");
+
+ Button btnNewButton_1 = new Button(composite_1, SWT.NONE);
+ btnNewButton_1.setText("Kernel Config");
+ btnNewButton_1.addSelectionListener(new SelectionListener() {
+ @Override
+ public void widgetDefaultSelected(SelectionEvent arg0) {
+ }
+
+ @Override
+ public void widgetSelected(SelectionEvent arg0) {
+ try {
+ Runtime.getRuntime().exec(new String[]{"gnome-terminal", "--command", "make menuconfig"}, null,
+ new File(WorkspaceUtil.getCurrentProjectPath() + File.separator + "os"));
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ });
tableViewer.setLabelProvider(new TableViewerProvider());
tableViewer.setContentProvider(new ArrayContentProvider());
// get divice list & extract Device Entry detailList From XML
RtosCommandManager rtosCommandMAnager = RtosCommandManager.getDeviceEntryManager();
- ArrayList<BuildOption> testList = rtosCommandMAnager.getBuildOptions();
+ List<BuildOption> testList = rtosCommandMAnager.getBuildOptions();
RtosBuildWizard wizard = (RtosBuildWizard) getWizard();
RtosBuildWizardDialog dialog = (RtosBuildWizardDialog) wizard.getContainer();
--- /dev/null
+package org.tizen.rt.ide.util;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.ISelectionService;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+
+public class WorkspaceUtil {
+
+ public static String getCurrentProjectPath() {
+ String projPath = null;
+
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ IEditorPart editorPart = window.getActivePage().getActiveEditor();
+ if (editorPart != null) {
+ IFileEditorInput input = (IFileEditorInput) editorPart.getEditorInput();
+ IFile file = input.getFile();
+ IProject activeProject = file.getProject();
+ projPath = activeProject.getLocation().toString();
+ } else {
+ ISelectionService selectionService = window.getSelectionService();
+ if (selectionService != null) {
+ ISelection selection = selectionService.getSelection();
+ if (selection instanceof IStructuredSelection) {
+ Object firstElement = ((IStructuredSelection) selection).getFirstElement();
+ if (firstElement instanceof IResource) {
+ IProject activeProject = ((IResource) firstElement).getProject();
+ projPath = activeProject.getLocation().toString();
+ }
+ }
+ }
+ }
+
+ return projPath;
+ }
+
+}