@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() }
@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(); }