use of org.eclipse.swt.layout.FillLayout in project cubrid-manager by CUBRID.
the class ObjectInfoComposite method initIndexTabItem.
/**
* Initial index tab index
*
*/
private void initIndexTabItem() {
CubridDatabase database = schemaNode.getDatabase();
CTabItem indexTabItem = new CTabItem(objInfoFolder, SWT.NONE);
indexTabItem.setText(Messages.titleIndex);
indexTabItem.setShowClose(false);
Composite composite = new Composite(objInfoFolder, SWT.None);
indexTabItem.setControl(composite);
composite.setLayout(new FillLayout());
final SashForm sashForm = new SashForm(composite, SWT.VERTICAL);
sashForm.setBackground(CombinedQueryEditorComposite.BACK_COLOR);
/*Index table composite*/
Composite indexComposite = new Composite(sashForm, SWT.None);
indexComposite.setLayout(new GridLayout());
/*FK table composite*/
Composite fkComposite = new Composite(sashForm, SWT.None);
fkComposite.setLayout(new GridLayout());
/*Set the sashform*/
sashForm.setWeights(new int[] { 1, 1 });
// create index table view
final Label indexLabel = new Label(indexComposite, SWT.NONE);
indexLabel.setText(Messages.lblIndexes);
indexTableViewer = new TableViewer(indexComposite, SWT.FULL_SELECTION | SWT.MULTI | SWT.BORDER);
Table indexTable = indexTableViewer.getTable();
indexTable.setLinesVisible(true);
indexTable.setHeaderVisible(true);
indexTable.setLayoutData(CommonUITool.createGridData(GridData.FILL_BOTH, 1, 1, -1, -1));
TableColumn tblCol = new TableColumn(indexTable, SWT.NONE);
tblCol.setWidth(150);
tblCol.setText(Messages.tblColumnIndexName);
TableColumn indexNameColumn = new TableColumn(indexTable, SWT.NONE);
indexNameColumn.setWidth(78);
indexNameColumn.setText(Messages.tblColumnIndexType);
TableColumn indexTypeColumn = new TableColumn(indexTable, SWT.NONE);
indexTypeColumn.setWidth(218);
indexTypeColumn.setText(Messages.tblColumnOnColumns);
TableColumn ruleColumn = new TableColumn(indexTable, SWT.NONE);
ruleColumn.setWidth(282);
ruleColumn.setText(Messages.tblColumnIndexRule);
IndexTableViewerContentProvider indexContentProvider = new IndexTableViewerContentProvider();
IndexTableViewerLabelProvider indexLabelProvider = new IndexTableViewerLabelProvider();
indexTableViewer.setContentProvider(indexContentProvider);
indexTableViewer.setLabelProvider(indexLabelProvider);
// create the fk table viewer
final Label fkLabel = new Label(fkComposite, SWT.NONE);
fkLabel.setText(Messages.lblFK);
fkTableViewer = new TableViewer(fkComposite, SWT.FULL_SELECTION | SWT.MULTI | SWT.BORDER);
Table fkTable = fkTableViewer.getTable();
fkTable.setLayoutData(CommonUITool.createGridData(GridData.FILL_BOTH, 1, 1, -1, -1));
fkTable.setLinesVisible(true);
fkTable.setHeaderVisible(true);
TableColumn fkNameColumn = new TableColumn(fkTable, SWT.NONE);
fkNameColumn.setWidth(100);
fkNameColumn.setText(Messages.tblColumnFK);
TableColumn fkColumnName = new TableColumn(fkTable, SWT.NONE);
fkColumnName.setWidth(119);
fkColumnName.setText(Messages.tblColumnColumnName);
TableColumn fTableColumn = new TableColumn(fkTable, SWT.NONE);
fTableColumn.setWidth(93);
fTableColumn.setText(Messages.tblColumnForeignTable);
TableColumn fkColumnNameColumn = new TableColumn(fkTable, SWT.NONE);
fkColumnNameColumn.setWidth(143);
fkColumnNameColumn.setText(Messages.tblColumnForeignColumnName);
TableColumn updateRuletblColumn = new TableColumn(fkTable, SWT.NONE);
updateRuletblColumn.setWidth(84);
updateRuletblColumn.setText(Messages.tblColumnUpdateRule);
TableColumn deleteRuleColumn = new TableColumn(fkTable, SWT.NONE);
deleteRuleColumn.setWidth(86);
deleteRuleColumn.setText(Messages.tblColumnDeleteRule);
TableColumn cacheColumn = new TableColumn(fkTable, SWT.NONE);
cacheColumn.setWidth(100);
cacheColumn.setText(Messages.tblColumnCacheColumn);
fkTableViewer.setContentProvider(new FKTableViewerContentProvider());
fkTableViewer.setLabelProvider(new FKTableViewerLabelProvider(database.getDatabaseInfo()));
}
use of org.eclipse.swt.layout.FillLayout in project cubrid-manager by CUBRID.
the class CombinedQueryEditorComposite method createResultFolder.
/**
* Create the result folder including query result and query plan result
*
* @param topSash SashForm
* @param sqlEditorParentComp Composite
*/
private void createResultFolder(final SashForm topSash, final Composite sqlEditorParentComp) {
final Composite resultComp = new Composite(topSash, SWT.NONE);
{
GridLayout gridLayout = new GridLayout();
gridLayout.horizontalSpacing = 0;
gridLayout.verticalSpacing = 0;
gridLayout.marginWidth = 0;
gridLayout.marginHeight = 0;
resultComp.setLayout(gridLayout);
resultComp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
}
// result folder
final CTabFolder resultTabFolder = new CTabFolder(resultComp, SWT.TOP);
resultTabFolder.setLayout(new FillLayout());
resultTabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
resultTabFolder.setSimple(false);
resultTabFolder.setUnselectedImageVisible(true);
resultTabFolder.setUnselectedCloseVisible(true);
resultTabFolder.setSelectionBackground(BACK_COLOR);
resultTabFolder.setSelectionForeground(ResourceManager.getColor(SWT.COLOR_BLACK));
resultTabFolder.setMinimizeVisible(true);
resultTabFolder.setMaximizeVisible(true);
this.resultTabFolder = resultTabFolder;
resultTabFolder.addCTabFolder2Listener(new CTabFolder2Listener() {
public void close(CTabFolderEvent event) {
}
public void maximize(CTabFolderEvent event) {
resultTabFolder.setMaximized(true);
topSash.setMaximizedControl(resultComp);
editor.getShowResultItem().setImage(CommonUIPlugin.getImage("icons/queryeditor/qe_panel_down.png"));
topSash.layout(true);
}
public void minimize(CTabFolderEvent event) {
resultTabFolder.setMinimized(true);
topSash.setMaximizedControl(sqlEditorParentComp);
editor.getShowResultItem().setImage(CommonUIPlugin.getImage("icons/queryeditor/qe_panel_up.png"));
topSash.layout(true);
}
public void restore(CTabFolderEvent event) {
resultTabFolder.setMinimized(false);
resultTabFolder.setMaximized(false);
topSash.setMaximizedControl(null);
editor.getShowResultItem().setImage(CommonUIPlugin.getImage("icons/queryeditor/qe_panel_down.png"));
topSash.layout(true);
}
public void showList(CTabFolderEvent event) {
}
});
// query result tab area
queryResultComp = new QueryResultComposite(resultTabFolder, SWT.NONE, editor);
// query plan result tab area
queryPlanResultComp = new QueryPlanCompositeWithHistory(resultTabFolder, SWT.NONE, editor);
// recently Used SQL tab area
recentlyUsedSQLComposite = new RecentlyUsedSQLComposite(resultTabFolder, SWT.NONE, editor);
recentlyUsedSQLComposite.initialize();
// create multiple query
multiDBQueryComp = new MultiDBQueryComposite(resultTabFolder, SWT.NONE, editor);
multiDBQueryComp.initialize();
}
use of org.eclipse.swt.layout.FillLayout in project cubrid-manager by CUBRID.
the class CombinedQueryEditorComposite method createTopSash.
/**
* Create the top sash for SQL editor and query result
*/
private void createTopSash() {
Composite topComp = new Composite(this, SWT.NONE);
topComp.setLayout(new FillLayout());
topSash = new SashForm(topComp, SWT.VERTICAL);
topSash.setBackground(SASH_COLOR);
topSash.setLayout(new FillLayout());
/* set top sash width to 0, the black line (topSash's background) won't be display
* set the normal width when change the editor database(there's no better way to set width)
* for TOOLS-2375
*/
topSash.setSashWidth(0);
Composite sqlEditorParentComp = createSQLEditor(topSash);
createResultFolder(topSash, sqlEditorParentComp);
topSash.setWeights(new int[] { QUERY_EDITOR_TOP_PCT, QUERY_EDITOR_BOTTOM_PCT });
}
use of org.eclipse.swt.layout.FillLayout in project cubrid-manager by CUBRID.
the class BLOBCellPopupDialog method createImageCanvas.
/**
*
* Create the image canvas
*
*/
private void createImageCanvas() {
imageCanvas = new Composite(dataComposite, SWT.NONE);
imageCanvas.setLayoutData(new GridData(GridData.FILL_BOTH));
imageCanvas.setLayoutData(CommonUITool.createGridData(GridData.FILL_BOTH, 3, 1, -1, -1));
imageCanvas.setLayout(new FillLayout());
InputStream in = null;
try {
if (currValue instanceof File) {
in = new FileInputStream((File) currValue);
} else if (currValue instanceof byte[]) {
in = new ByteArrayInputStream((byte[]) currValue);
}
if (in == null) {
imageCanvas.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
return;
}
ImageLoader loader = new ImageLoader();
ImageData[] imageDatas = loader.load(in);
if (imageDatas == null || imageDatas.length == 0) {
imageCanvas.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
return;
}
imageViewer = new ImageViewer(imageCanvas);
if (imageDatas.length == 1) {
imageViewer.setImage(imageDatas[0]);
} else {
imageViewer.setImages(imageDatas, loader.repeatCount);
}
imageViewer.pack();
} catch (Exception ex) {
imageCanvas.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
} finally {
Closer.close(in);
}
dataComposite.layout();
}
use of org.eclipse.swt.layout.FillLayout in project azure-tools-for-java by Microsoft.
the class JobViewEditor method createPartControl.
@Override
public void createPartControl(Composite composite) {
composite.setLayout(new FillLayout());
final String indexPath = PluginUtil.pluginFolder + "/com.microsoft.azuretools.hdinsight/html" + "/hdinsight/job/html/index.html";
File indexFile = new File(indexPath);
if (indexFile.exists()) {
final String queryString = "?projectid=" + uuid + "&engintype=javafx&sourcetype=eclipse&clustername=" + clusterDetail.getName();
final String webUrl = "file:///" + indexPath.replace("\\", "/") + queryString;
FxClassLoader.loadJavaFxForJobView(composite, webUrl);
} else {
DefaultLoader.getUIHelper().showError("HDInsight Job view index page not exist!", "job view");
}
}
Aggregations