/** * DOC ocarbone Comment method "addTreeNavigator". * * @param parent * @param width * @param height */ private void addTreeNavigator(Composite parent, int width, int height) { // Group Group group = Form.createGroup( parent, 1, Messages.getString("DatabaseTableForm.navigatorTree"), height); //$NON-NLS-1$ // ScrolledComposite ScrolledComposite scrolledCompositeFileViewer = new ScrolledComposite(group, SWT.H_SCROLL | SWT.V_SCROLL | SWT.NONE); scrolledCompositeFileViewer.setExpandHorizontal(true); scrolledCompositeFileViewer.setExpandVertical(true); GridData gridData1 = new GridData(GridData.FILL_BOTH); gridData1.widthHint = width + 12; gridData1.heightHint = height; gridData1.horizontalSpan = 2; scrolledCompositeFileViewer.setLayoutData(gridData1); tableViewerCreator = new TableViewerCreator(scrolledCompositeFileViewer); tableViewerCreator.setHeaderVisible(false); tableViewerCreator.setColumnsResizableByDefault(false); tableViewerCreator.setBorderVisible(false); tableViewerCreator.setLinesVisible(false); tableViewerCreator.setLayoutMode(LAYOUT_MODE.NONE); tableViewerCreator.setCheckboxInFirstColumn(false); tableViewerCreator.setFirstColumnMasked(false); tableNavigator = tableViewerCreator.createTable(); tableNavigator.setLayoutData(new GridData(GridData.FILL_BOTH)); TableColumn tableColumn = new TableColumn(tableNavigator, SWT.NONE); tableColumn.setText( Messages.getString("DatabaseTableForm.tableColumnText.talbe")); // $NON-NLS-1$ tableColumn.setWidth(width + 120); scrolledCompositeFileViewer.setContent(tableNavigator); scrolledCompositeFileViewer.setSize(width + 12, height); // // Button Add metadata Table Composite button = Form.startNewGridLayout(group, HEIGHT_BUTTON_PIXEL, false, SWT.CENTER, SWT.CENTER); addTableButton = new UtilsButton( button, Messages.getString("DatabaseTableForm.AddTable"), width - 30, HEIGHT_BUTTON_PIXEL); //$NON-NLS-1$ Composite rmButton = Form.startNewGridLayout(group, HEIGHT_BUTTON_PIXEL, false, SWT.CENTER, SWT.CENTER); removeTableButton = new UtilsButton(rmButton, "Remove Schema", width - 30, HEIGHT_BUTTON_PIXEL); // $NON-NLS-1$ }
private void addOozieAuthenticationFields() { Group authGroup = Form.createGroup(this, 1, "Authentication Settings"); authGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); kerbBtn = new Button(authGroup, SWT.CHECK); kerbBtn.setText("Enable oozie kerberos security"); kerbBtn.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1)); userNameText = new LabelledText(authGroup, Messages.getString("OozieForm.userName"), 1); // $NON-NLS-1$ }
@Override protected void addFields() { // Header Fields Composite mainComposite = Form.startNewDimensionnedGridLayout(this, 2, WIDTH_GRIDDATA_PIXEL, 60); metadataNameText = new LabelledText( mainComposite, Messages.getString("FileStep3.metadataName")); // $NON-NLS-1$ metadataCommentText = new LabelledText( mainComposite, Messages.getString("FileStep3.metadataComment")); // $NON-NLS-1$ // Group MetaData Group groupMetaData = Form.createGroup( this, 1, Messages.getString("FileStep3.groupMetadata"), 280); // $NON-NLS-1$ Composite compositeMetaData = Form.startNewGridLayout(groupMetaData, 1); // Composite Guess Composite compositeGuessButton = Form.startNewDimensionnedGridLayout(compositeMetaData, 2, WIDTH_GRIDDATA_PIXEL, 40); informationLabel = new Label(compositeGuessButton, SWT.NONE); informationLabel.setText( Messages.getString("FileStep3.informationLabel") + " "); //$NON-NLS-1$ //$NON-NLS-2$ informationLabel.setSize(500, HEIGHT_BUTTON_PIXEL); guessButton = new UtilsButton( compositeGuessButton, Messages.getString("FileStep3.guess"), WIDTH_BUTTON_PIXEL, //$NON-NLS-1$ HEIGHT_BUTTON_PIXEL); guessButton.setToolTipText(Messages.getString("FileStep3.guessTip")); // $NON-NLS-1$ // Composite MetadataTableEditorView Composite compositeTable = Form.startNewDimensionnedGridLayout(compositeMetaData, 1, WIDTH_GRIDDATA_PIXEL, 200); compositeTable.setLayout(new FillLayout()); metadataEditor = new MetadataEmfTableEditor( Messages.getString("FileStep3.metadataDescription")); // $NON-NLS-1$ tableEditorView = new MetadataEmfTableEditorView(compositeTable, SWT.NONE); if (!isInWizard()) { // Bottom Button Composite compositeBottomButton = Form.startNewGridLayout(this, 2, false, SWT.CENTER, SWT.CENTER); // Button Cancel cancelButton = new UtilsButton( compositeBottomButton, Messages.getString("CommonWizard.cancel"), WIDTH_BUTTON_PIXEL, //$NON-NLS-1$ HEIGHT_BUTTON_PIXEL); } // addUtilsButtonListeners(); changed by hqzhang, need not call here, has been called in // setupForm() }
private void addConnectionFields() { Group connectionGroup = Form.createGroup(this, 1, Messages.getString("OozieForm.connectionSetting")); // $NON-NLS-1$ connectionGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); Composite connectionPartComposite = new Composite(connectionGroup, SWT.NULL); connectionPartComposite.setLayout(new GridLayout(2, false)); connectionPartComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); endPonitText = new LabelledText( connectionPartComposite, Messages.getString("OozieForm.endPoint"), 1); // $NON-NLS-1$ }
private void addCheckFields() { Composite checkGroup = new Composite(this, SWT.NONE); GridLayout checkGridLayout = new GridLayout(1, false); checkGroup.setLayout(checkGridLayout); GridData checkGridData = new GridData(GridData.FILL_HORIZONTAL); checkGridData.minimumHeight = 5; checkGroup.setLayoutData(checkGridData); Composite checkButtonComposite = Form.startNewGridLayout(checkGroup, 1, false, SWT.CENTER, SWT.BOTTOM); GridLayout checkButtonLayout = (GridLayout) checkButtonComposite.getLayout(); checkButtonLayout.marginHeight = 0; checkButtonLayout.marginTop = 0; checkButtonLayout.marginBottom = 0; checkButtonLayout.marginLeft = 0; checkButtonLayout.marginRight = 0; checkButtonLayout.marginWidth = 0; checkConnectionBtn = new UtilsButton( checkButtonComposite, Messages.getString("OozieForm.check"), WIDTH_BUTTON_PIXEL, HEIGHT_BUTTON_PIXEL); //$NON-NLS-1$ checkConnectionBtn.setEnabled(false); }
@Override protected void addFields() { int leftCompositeWidth = 125; int rightCompositeWidth = WIDTH_GRIDDATA_PIXEL - leftCompositeWidth; int headerCompositeHeight = 80; int tableSettingsCompositeHeight = 15; int tableCompositeHeight = 200; int height = headerCompositeHeight + tableSettingsCompositeHeight + tableCompositeHeight; // Header Fields Composite mainComposite = Form.startNewDimensionnedGridLayout(this, 2, WIDTH_GRIDDATA_PIXEL, 60); SashForm sash = new SashForm(mainComposite, SWT.HORIZONTAL); GridData sashData = new GridData(GridData.FILL_BOTH); sash.setLayoutData(sashData); Composite leftComposite = Form.startNewDimensionnedGridLayout(sash, 1, leftCompositeWidth, height); Composite rightComposite = Form.startNewDimensionnedGridLayout(sash, 1, rightCompositeWidth, height); sash.setWeights(new int[] {1, 5}); addTreeNavigator(leftComposite, leftCompositeWidth, height); metadataNameText = new LabelledText( rightComposite, Messages.getString("FileStep3.metadataName")); // $NON-NLS-1$ metadataCommentText = new LabelledText( rightComposite, Messages.getString("FileStep3.metadataComment")); // $NON-NLS-1$ // Group MetaData Group groupMetaData = Form.createGroup( rightComposite, 1, Messages.getString("FileStep3.groupMetadata"), 280); // $NON-NLS-1$ Composite compositeMetaData = Form.startNewGridLayout(groupMetaData, 1); // Composite Guess Composite compositeGuessButton = Form.startNewDimensionnedGridLayout(compositeMetaData, 2, WIDTH_GRIDDATA_PIXEL, 40); informationLabel = new Label(compositeGuessButton, SWT.NONE); informationLabel.setText( Messages.getString("FileStep3.informationLabel") + " "); //$NON-NLS-1$ //$NON-NLS-2$ informationLabel.setSize(500, HEIGHT_BUTTON_PIXEL); guessButton = new UtilsButton( compositeGuessButton, Messages.getString("FileStep3.guess"), WIDTH_BUTTON_PIXEL, //$NON-NLS-1$ HEIGHT_BUTTON_PIXEL); guessButton.setToolTipText(Messages.getString("FileStep3.guessTip")); // $NON-NLS-1$ // Composite MetadataTableEditorView Composite compositeTable = Form.startNewDimensionnedGridLayout(compositeMetaData, 1, WIDTH_GRIDDATA_PIXEL, 200); compositeTable.setLayout(new FillLayout()); metadataEditor = new MetadataEmfTableEditor( Messages.getString("FileStep3.metadataDescription")); // $NON-NLS-1$ tableEditorView = new MetadataEmfTableEditorView(compositeTable, SWT.NONE); if (!isInWizard()) { // Bottom Button Composite compositeBottomButton = Form.startNewGridLayout(this, 2, false, SWT.CENTER, SWT.CENTER); // Button Cancel cancelButton = new UtilsButton( compositeBottomButton, Messages.getString("CommonWizard.cancel"), WIDTH_BUTTON_PIXEL, //$NON-NLS-1$ HEIGHT_BUTTON_PIXEL); } addUtilsButtonListeners(); }