import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.console.MessageConsole;
+import org.eclipse.ui.internal.console.IOConsoleViewer;
import org.tizen.common.util.DialogUtil;
import org.tizen.nativeplatform.pkg.commander.ICommandStatus;
import org.tizen.nativeplatform.pkg.commander.IPkgCommander;
protected Combo categoryCombo;
protected Text filterText;
protected Text logText;
+ protected IOConsoleViewer logViewer;
protected String logs = "";
protected final Shell shell;
createRepositoryGroup(composite);
createPackageGroup(composite);
- createLogGroup(composite);
+ createLogSeparator(composite);
+ createLogViewer(composite);
}
- private void createLogGroup(Composite parent) {
- Group grpRepo = new Group(parent, SWT.NONE);
- grpRepo.setText("Log");
- GridData log_gd = new GridData(GridData.FILL_HORIZONTAL);
- log_gd.heightHint = 150;
- grpRepo.setLayoutData(log_gd);
- grpRepo.setLayout(new GridLayout(1, false));
-
- createTextArea(grpRepo);
+ private void createLogSeparator(Composite parent) {
+ Label logLabel = new Label(parent, SWT.HORIZONTAL | SWT.SEPARATOR);
+ logLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
}
- private void createTextArea(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
- GridData gridData = new GridData(GridData.FILL_BOTH);
- composite.setLayoutData(gridData);
- composite.setLayout(new GridLayout(1, false));
+ private void createLogViewer(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE | SWT.BORDER);
+ GridData log_gd = new GridData(GridData.FILL_BOTH);
+ log_gd.heightHint = 150;
+ composite.setLayoutData(log_gd);
+ composite.setLayout(new FillLayout());
- logText = new Text(composite, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER
- | SWT.READ_ONLY);
- logText.setLayoutData(new GridData(GridData.FILL_BOTH));
+ MessageConsole c = commander.getOutputReceiver().getMsgConsoleStream().getConsole();
+ logViewer = new IOConsoleViewer(composite, c);
+ // Positions the cursor at the end of the log.
+ int line = logViewer.getTextWidget().getLineCount();
+ if (line > 0) {
+ logViewer.getTextWidget().setTopIndex(line);
+ }
}
private void createRepositoryGroup(Composite parent) {
}
private void createPackageTableColumns(Composite parent) {
- String[] titles = { "S", "Package Name", "Installed Version", "New Version", "Arch",
- "Description" };
- int[] bounds = { 24, 200, 150, 150, 60, 150 };
+ String[] titles = { "S", "Package Name", "Installed Version", "New Version", "Arch", };
+ int[] bounds = { 24, 250, 200, 200, 60 };
TableViewerColumn colSelection = createTableViewerColumn(pkgViewer, titles[0], bounds[0],
SWT.NONE);
return arch;
}
});
-
- TableViewerColumn colDescription = createTableViewerColumn(pkgViewer, titles[5], bounds[5],
- SWT.NONE);
- colDescription.setLabelProvider(new ColumnLabelProvider() {
- @Override
- public String getText(Object element) {
- return "";
- }
- });
+ /*
+ * TableViewerColumn colDescription = createTableViewerColumn(pkgViewer,
+ * titles[5], bounds[5], SWT.NONE); colDescription.setLabelProvider(new
+ * ColumnLabelProvider() {
+ *
+ * @Override public String getText(Object element) { return ""; } });
+ */
}
protected void handleRefreshRepositoryButton() {
}
protected void updateLog() {
- logText.setText(logs);
- logText.setSelection(logText.getText().length());
+ // logText.setText(logs);
+ // logText.setSelection(logText.getText().length());
}
}