private void createControlsPanel(Composite theParent) { ScrolledComposite scroller = new ScrolledComposite(theParent, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER); GridLayout scrolledLayout = new GridLayout(); scrolledLayout.marginLeft = 5; scrolledLayout.marginRight = 5; scroller.setLayout(scrolledLayout); scroller.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); scroller.setExpandHorizontal(true); scroller.setExpandVertical(true); scroller.setMinWidth(900); scroller.setMinHeight(270); Group controlsGroup = WidgetFactory.createGroup(scroller, EDIT_TXT); GridLayout controlsLayout = new GridLayout(); controlsLayout.marginLeft = 0; controlsLayout.marginRight = 0; controlsGroup.setLayout(controlsLayout); controlsGroup.setLayoutData(new GridData(GridData.FILL_BOTH)); createResolveAttributePanel(controlsGroup); createResolveSqlPanel(controlsGroup); scroller.setContent(controlsGroup); }
/** Initialize the panel. */ private void init() { // ------------------------------ // Set layout for the SashForm // ------------------------------ GridLayout gridLayout = new GridLayout(); this.setLayout(gridLayout); gridLayout.numColumns = 1; gridLayout.marginLeft = 20; GridData gridData = new GridData(GridData.FILL_BOTH); this.setLayoutData(gridData); // Init the symbol arrays from bindings this.bindingListInput = new BindingTableInput(createBindingList(originalBindingList)); // ---------------------------------- // Create the Table Viewer Panel // ---------------------------------- createTableViewerPanel(this); // Initialize the message area at the top of the dialog datatypeReconcilerDialog.setTitle(Messages.datatypeReconciler_statusTitle); updateMessageArea(); // Listen for TableSelection from the Tables bindingTableViewer.addSelectionChangedListener(this); selectFirstTypeConflict(); bindingListInput.datatypeChanged(); }
protected void zeroMargins(GridLayout layout) { layout.marginLeft = 0; layout.marginTop = 0; layout.marginBottom = 0; layout.marginHeight = 0; layout.marginWidth = 0; }
@Override public void createPartControl(Composite parent) { FormToolkit toolkit = new FormToolkit(parent.getDisplay()); m_sform = toolkit.createScrolledForm(parent); m_sform.setText("FIAT News Search"); m_sform.getBody().setLayout(new GridLayout()); Composite editorComposite = m_sform.getBody(); GridLayout layout = new GridLayout(); layout.marginBottom = 10; layout.marginTop = 10; layout.marginLeft = 10; layout.marginRight = 10; layout.numColumns = 1; layout.makeColumnsEqualWidth = true; layout.verticalSpacing = 5; layout.horizontalSpacing = 5; editorComposite.setLayout(layout); editorComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); createContent(editorComposite, toolkit); m_sform.reflow(true); m_sform.setFocus(); m_selectionProvider = new FiatNewsSearchViewSelectionProvider(); getSite().setSelectionProvider(m_selectionProvider); m_SparqlQueryHelper = new SparqlQueryHelper(); }
@Override protected Control createDialogArea(Composite parent) { Composite container = (Composite) super.createDialogArea(parent); GridLayout layout = new GridLayout(1, false); layout.marginRight = 5; layout.marginLeft = 10; container.setLayout(layout); setTitle(messages.getString("IADialog_0")); setMessage(messages.getString("IADialog_1"), IMessageProvider.INFORMATION); for (int i = 0; i < productDescr.size() - 1; i = i + 2) { final Label lblProduct = new Label(container, SWT.WRAP); final Label lblAction = new Label(container, SWT.WRAP); final GridData data = new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1); lblProduct.setLayoutData(data); lblProduct.setText(productDescr.get(i)); lblAction.setLayoutData(data); lblAction.setText(" " + productDescr.get(i + 1)); // $NON-NLS-1$ } return container; }
public FilterAdvancedComposite( final FilterChangedListener filterChangedListener, final Composite parent, final int style) { // fields super(parent, style); // widgets this.tabFolder = new CTabFolder(this, SWT.TOP | SWT.BORDER | SWT.CLOSE); this.addOrConditionButton = creteAddOrConditionButton(); addOrCondition(); // layout final GridLayout layout = new GridLayout(1, true); layout.marginLeft = 6; layout.marginRight = 6; layout.marginTop = 6; layout.marginBottom = 6; layout.verticalSpacing = 12; this.setLayout(layout); final GridData tabFolderLayoutData = new GridData(); tabFolderLayoutData.horizontalAlignment = GridData.FILL; tabFolderLayoutData.grabExcessHorizontalSpace = true; tabFolderLayoutData.verticalAlignment = GridData.FILL; tabFolderLayoutData.grabExcessVerticalSpace = true; this.tabFolder.setLayoutData(tabFolderLayoutData); this.tabFolder.setBackgroundMode(SWT.INHERIT_FORCE); final GridData addOrConditionButtonLayoutdata = new GridData(); addOrConditionButtonLayoutdata.horizontalAlignment = GridData.END; this.addOrConditionButton.setLayoutData(addOrConditionButtonLayoutdata); }
public GridLayoutConfig margin(int top, int right, int bottom, int left) { layout.marginTop = top; layout.marginRight = right; layout.marginBottom = bottom; layout.marginLeft = left; return this; }
private void configureButtonCompositeLayout(Composite composite) { GridLayout layout = (GridLayout) composite.getLayout(); layout.marginLeft = 20; layout.marginRight = 20; layout.marginTop = 0; layout.horizontalSpacing = 10; layout.verticalSpacing = 10; }
public static void main(String[] args) { Display display = Display.getDefault(); final Shell shell = new Shell(display, SWT.TITLE | SWT.CLOSE); shell.setText(TITLE); final String C10T_PATH = System.getenv("C10T_PATH"); final C10tGraphicalInterface gui = new C10tGraphicalInterface(display, shell); final DetachedProcess detachedProcess = new C10tDetachedProcess(gui); final CommandExecutioner executioner = new CommandExecutioner("c10t", detachedProcess, C10T_PATH); gui.addRenderButtonListener(new RenderSelection(shell, gui, executioner)); GridLayout gridLayout = new GridLayout(); gridLayout.numColumns = 3; gridLayout.marginBottom = 8; gridLayout.marginTop = 8; gridLayout.marginLeft = 8; gridLayout.marginRight = 8; shell.setLayout(gridLayout); shell.pack(); shell.open(); shell.setSize(500, shell.getSize().y); try { executioner.findCommand(); } catch (CommandNotFoundException e) { MessageBox messageBox = new MessageBox(shell, SWT.ERROR); messageBox.setText("c10t - Command could not be found"); messageBox.setMessage( "The program `" + executioner.getName() + "' could not be located anywhere in your PATH or in the current working directory\n\n" + "You must be fixed this by doing one of the following:\n\n" + " 1) Install the command `" + executioner.getName() + "' to somewhere in your PATH or the working directory of this program `" + System.getProperty("user.dir") + "'\n" + " 2) Specify where the command is with the environment variable `C10T_PATH'\n\n" + "Your PATH is: " + System.getenv("PATH")); messageBox.open(); } while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } if (!display.isDisposed()) { display.dispose(); } }
public void createDragSourceComposite(Composite parent, IReferenceNodeInfo referenceNodeInfo) { // Composite c = new Composite(parent, SWT.BORDER); Group c = new Group(parent, SWT.SHADOW_ETCHED_IN); GridLayout gl = new GridLayout(2, false); gl.marginTop = 1; gl.marginBottom = 5; gl.marginLeft = 1; gl.marginRight = 1; gl.marginHeight = 1; gl.marginWidth = 1; gl.verticalSpacing = 0; gl.horizontalSpacing = 0; c.setLayout(gl); c.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE)); Label il = new Label(c, SWT.LEFT | SWT.NO_FOCUS); il.setImage(resources.getPlatformImage(ISharedImages.IMG_OBJS_INFO_TSK)); il.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE)); Label l = new Label(c, SWT.LEFT | SWT.NO_FOCUS); l.setText("Drag this area to a target in the tree to quick-link."); l.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE)); c.pack(); DragSource[] sources = new DragSource[] { // new DragSource(il, DND.DROP_MOVE | DND.DROP_COPY), new DragSource(l, DND.DROP_MOVE | DND.DROP_COPY), new DragSource(c, DND.DROP_MOVE | DND.DROP_COPY), }; final ObjRef fParentRef = referenceNodeInfo.getParentRef(); final String fFeatureName = referenceNodeInfo.getFeatureName(); for (DragSource source : sources) { Transfer[] types = new Transfer[] {TextTransfer.getInstance()}; source.setTransfer(types); source.addDragListener( new DragSourceListener() { @Override public void dragStart(DragSourceEvent event) { event.doit = true; } @Override public void dragSetData(DragSourceEvent event) { if (TextTransfer.getInstance().isSupportedType(event.dataType)) { event.data = "$LINK$" + fFeatureName + "$" + xarch.getXPath(fParentRef); } } @Override public void dragFinished(DragSourceEvent event) { if (event.detail == DND.DROP_MOVE) {} } }); } }
public WaveformViewerPanel(Composite parent) { super(parent, SWT.NONE); GridLayout gridLayout = new GridLayout(); gridLayout.marginLeft = 0; gridLayout.marginRight = 0; setLayout(gridLayout); canvas = new WaveformCanvas(this); canvas.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); }
private void configureDialogLayout(Composite composite) { GridLayout layout = (GridLayout) composite.getLayout(); layout.numColumns = 2; layout.marginLeft = 10; layout.marginRight = 10; layout.marginTop = 30; layout.marginBottom = 0; layout.horizontalSpacing = 20; layout.verticalSpacing = 10; }
private GridLayout makeGroupLayout(int spacing) { GridLayout layout = new GridLayout(3, false); layout.marginTop = spacing; layout.marginBottom = spacing; layout.marginLeft = spacing; layout.marginRight = spacing; layout.verticalSpacing = spacing; layout.horizontalSpacing = spacing; return layout; }
void createPopup(String[] items, int selectionIndex) { // create shell and list popup = new AlphaDialog(getShell(), SWT.NO_TRIM | SWT.ON_TOP | SWT.BORDER); popup.setBackgroundMode(SWT.INHERIT_DEFAULT); Color borderColor = ColorCache.getInstance().getColor(200, 200, 200); popup.setBackground(borderColor); GridLayout gridLayout = new GridLayout(2, false); gridLayout.marginHeight = 0; gridLayout.marginBottom = 1; gridLayout.marginTop = 0; gridLayout.marginLeft = 0; gridLayout.marginRight = 0; gridLayout.horizontalSpacing = 0; gridLayout.verticalSpacing = 0; gridLayout.marginWidth = 0; popup.getPopup().setLayout(gridLayout); int style = getStyle(); int listStyle = SWT.SINGLE | SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER; if ((style & SWT.FLAT) != 0) listStyle |= SWT.FLAT; if ((style & SWT.RIGHT_TO_LEFT) != 0) listStyle |= SWT.RIGHT_TO_LEFT; if ((style & SWT.LEFT_TO_RIGHT) != 0) listStyle |= SWT.LEFT_TO_RIGHT; list = new List(popup.getPopup(), listStyle); GridData gridData = new GridData(GridData.FILL_BOTH); gridData.horizontalSpan = 2; list.setLayoutData(gridData); list.addMouseListener( new MouseAdapter() { public void mouseDown(MouseEvent e) { if (e.button == 3) { text.getMenu().setVisible(true); } if (list.isFocusControl()) return; text.forceFocus(); list.setFocus(); } }); if (font != null) list.setFont(font); if (foreground != null) list.setForeground(foreground); if (background != null) list.setBackground(background); int[] popupEvents = {SWT.Close, SWT.Paint, SWT.Deactivate}; for (int i = 0; i < popupEvents.length; i++) popup.getPopup().addListener(popupEvents[i], listener); int[] listEvents = { SWT.MouseUp, SWT.Selection, SWT.Traverse, SWT.KeyDown, SWT.KeyUp, SWT.FocusIn, SWT.Dispose }; for (int i = 0; i < listEvents.length; i++) list.addListener(listEvents[i], listener); if (items != null) list.setItems(items); if (selectionIndex != -1) list.setSelection(selectionIndex); }
public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); GridLayout gridLayout = new GridLayout(1, false); gridLayout.marginLeft = 10; gridLayout.marginTop = 10; gridLayout.marginBottom = 10; gridLayout.marginRight = 10; shell.setLayout(gridLayout); final Table table = new Table(shell, SWT.BORDER | SWT.VIRTUAL | SWT.CHECK | SWT.FULL_SELECTION); table.setHeaderVisible(true); table.setLayoutData(new GridData(GridData.FILL_BOTH)); table.addListener( SWT.SetData, new Listener() { public void handleEvent(Event event) { TableItem item = (TableItem) event.item; int index = table.indexOf(item); boolean checked = myModel[index]; item.setChecked(checked); item.setText(0, "Row " + index + ": " + checked); } }); TableColumn tableColumn = new TableColumn(table, SWT.LEFT); tableColumn.setWidth(100); tableColumn.setText("BlahBlah"); table.setItemCount(myModel.length); table.clearAll(); table.addListener( SWT.Selection, new Listener() { public void handleEvent(Event e) { if (e.detail == SWT.CHECK) { TableItem item = (TableItem) e.item; int index = table.indexOf(item); boolean isChecked = item.getChecked(); myModel[index] = isChecked; myModel[index / 2] = isChecked; table.clear(new int[] {index, index / 2}); } } }); shell.setSize(400, 300); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); }
private void createMainComposite() { logger.log(Level.INFO, "Detail panel: Creating main composite ..."); GridLayout mainCompositeGridLayout = new GridLayout(3, false); mainCompositeGridLayout.marginTop = 0; mainCompositeGridLayout.marginLeft = 0; mainCompositeGridLayout.marginRight = 0; setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1)); setLayout(mainCompositeGridLayout); }
public OrCondition( final FilterAdvancedComposite filterAdvancedComposite, final CTabFolder tabFolder) { // fields this.filterAdvancedComposite = filterAdvancedComposite; this.tabItem = new CTabItem(tabFolder, SWT.NULL); this.tabItem.setText(Messages.a_condition); this.tabContent = new Composite(tabFolder, SWT.NONE); this.tabItem.setControl(this.tabContent); // widgets this.addAssertionComposite = new AddAssertionComposite(this, this.tabContent); this.assertionScrolledComposite = new ScrolledComposite(this.tabContent, SWT.V_SCROLL | SWT.NONE); this.assertionComposite = new Composite(this.assertionScrolledComposite, SWT.NONE); this.assertionScrolledComposite.setContent(this.assertionComposite); // layout final GridLayout layout = new GridLayout(); layout.marginLeft = 6; layout.marginRight = 6; layout.marginTop = 6; layout.marginBottom = 6; layout.verticalSpacing = 12; this.tabContent.setLayout(layout); final GridData addAssertionCompositeLayoutData = new GridData(); addAssertionCompositeLayoutData.grabExcessHorizontalSpace = true; addAssertionCompositeLayoutData.horizontalAlignment = GridData.FILL; this.addAssertionComposite.setLayoutData(addAssertionCompositeLayoutData); final GridData assertionCompositeLayoutData = new GridData(); assertionCompositeLayoutData.grabExcessHorizontalSpace = true; assertionCompositeLayoutData.horizontalAlignment = GridData.FILL; assertionCompositeLayoutData.grabExcessVerticalSpace = true; assertionCompositeLayoutData.verticalAlignment = GridData.FILL; this.assertionScrolledComposite.setLayoutData(assertionCompositeLayoutData); this.assertionScrolledComposite.setExpandHorizontal(true); final RowLayout innerlayout = new RowLayout(SWT.VERTICAL); innerlayout.wrap = false; this.assertionComposite.setLayout(innerlayout); this.assertionComposite.addListener( SWT.Resize, new Listener() { public void handleEvent(final org.eclipse.swt.widgets.Event event) { final Point s = OrCondition.this.assertionComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT); OrCondition.this.assertionComposite.setSize(s.x, s.y); refreshGUI(); } }); }
private static GridLayout convertIntoSWTGridLayout(GridLayoutRule rule) { GridLayout gridLayout = new GridLayout(); gridLayout.horizontalSpacing = rule.getHorizontalSpacing(); gridLayout.makeColumnsEqualWidth = rule.isMakeColumnsEqualWidth(); gridLayout.marginBottom = rule.getMarginBottom(); gridLayout.marginHeight = rule.getMarginHeight(); gridLayout.marginLeft = rule.getMarginLeft(); gridLayout.marginRight = rule.getMarginRight(); gridLayout.marginTop = rule.getMarginTop(); gridLayout.marginWidth = rule.getMarginWidth(); gridLayout.numColumns = rule.getNumColumns(); gridLayout.verticalSpacing = rule.getVerticalSpacing(); return gridLayout; }
public void create() { label = new Label(parent, SWT.NULL); String labelText = type.getName(); if (showValidationHint && useValidationGUIHints) { refontLabel(true); } label.setText(type.getName()); Composite container = new Composite(parent, SWT.NULL); GridLayout contLayout = new GridLayout(3, false); contLayout.horizontalSpacing = 5; contLayout.marginLeft = 0; contLayout.marginWidth = 0; contLayout.marginHeight = 0; container.setLayout(contLayout); GridData containerLData = new GridData(); containerLData.horizontalAlignment = GridData.FILL; containerLData.grabExcessHorizontalSpace = true; container.setLayoutData(containerLData); link = new Link(container, SWT.NONE); link.setToolTipText(this.type.getTooltiptext()); link.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 1, 1)); link.addListener( SWT.Selection, new Listener() { public void handleEvent(Event event) { if (getHref() != null && getHref().length() > 0) Program.launch(getHref()); } }); Button editBtn = new Button(container, SWT.PUSH); editBtn.setText(Messages.getString("URLControl.1")); // $NON-NLS-1$ editBtn.setToolTipText(this.type.getTooltiptext()); editBtn.setEnabled(editable); editBtn.addSelectionListener( new SelectionListener() { public void widgetSelected(SelectionEvent arg0) { showLinkEditDialog(); } public void widgetDefaultSelected(SelectionEvent arg0) { showLinkEditDialog(); } }); setLinkText(); }
@Override public void createControl(Composite parent) { setTitle("Identify Maven dependencies"); initImages(); Composite container = new Composite(parent, SWT.NONE); container.setEnabled(true); setControl(container); GridLayout layout = new GridLayout(3, false); layout.marginLeft = 12; container.setLayout(layout); container.setLayoutData(new GridData(GridData.FILL_BOTH)); setMessage(MESSAGE); createWarning(container); displayDependenciesTable(container); Link remoteRepoPrefsLink = new Link(container, SWT.NONE); remoteRepoPrefsLink.setText("Manage <a>remote repositories</a> used to identify dependencies."); GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1); remoteRepoPrefsLink.setLayoutData(gd); remoteRepoPrefsLink.addSelectionListener( new SelectionListener() { public void widgetSelected(SelectionEvent e) { openRemoteRepoPrefs(); } public void widgetDefaultSelected(SelectionEvent e) { widgetSelected(e); } }); deleteJars = dialogSettings.getBoolean("isDeleteJars"); deleteJarsBtn = addCheckButton(container, "Delete original references from project", deleteJars); deleteJarsBtn.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { deleteJars = deleteJarsBtn.getSelection(); } }); runIdentificationJobs(null); }
private void init(Composite topAttachement) { GridLayout gridLayout = new GridLayout(2, false); gridLayout.marginLeft = 10; group.setLayout(gridLayout); FormData formData = new FormData(); if (topAttachement == null) { formData.top = new FormAttachment(0); } else { formData.top = new FormAttachment(topAttachement); } formData.left = new FormAttachment(0); formData.right = new FormAttachment(100); group.setLayoutData(formData); composites.add(new NoBoundElementComposite(group, LBL_EMPTY_SELECTION)); }
private Button createPerspectiveButton(final IPerspectiveDescriptor desc) { Button result = perspectiveButtonMap.get(desc); if (result == null && desc != null && desc.getLabel() != null) { Composite buttonBg = new Composite(background, SWT.NONE); GridLayout layout = new GridLayout(); layout.marginBottom = 0; layout.marginTop = 0; layout.marginLeft = 0; layout.marginRight = 0; layout.marginWidth = 0; layout.marginHeight = 0; buttonBg.setLayout(layout); final Button perspButton = new Button(buttonBg, SWT.PUSH | SWT.FLAT); perspButton.setData(RWT.CUSTOM_VARIANT, ICSSConstants.PERSP_BOTTON); perspButton.setText(desc.getLabel()); perspButton.setImage(desc.getImageDescriptor().createImage()); perspButton.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, true)); Label indicator = new Label(buttonBg, SWT.NONE); indicator.setImage(bgActive); indicator.setLayoutData(new GridData(SWT.CENTER, SWT.BOTTOM, false, false)); RowData rd = new RowData(); rd.height = 60; buttonBg.setLayoutData(rd); perspectiveButtonMap.put(desc, perspButton); buttonPerspectiveMap.put(perspButton, desc); buttonList.add(perspButton); perspButton.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { cleanButtons(perspButton); switchPerspective(desc.getId()); } }); result = perspButton; } return result; }
/* (non-Javadoc) * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite) */ @Override protected Control createDialogArea(Composite parent) { setTitle( NLS.bind( SnippetMessages.getString( "SelectImportsDialog.Manage_the_Java_Snippet_Editor_Imports_for___{0}__1"), new String[] {fEditor.getEditorInput().getName()})); // $NON-NLS-1$ setMessage( NLS.bind( SnippetMessages.getString("SelectImportsDialog.add_remove_imports"), new String[] {fEditor.getEditorInput().getName()})); // $NON-NLS-1$ Composite outer = SWTFactory.createComposite(parent, 2, 1, GridData.FILL_BOTH); GridLayout gl = (GridLayout) outer.getLayout(); gl.marginLeft = 7; gl.marginTop = 0; gl.marginBottom = 0; SWTFactory.createLabel( outer, SnippetMessages.getString("SelectImportsDialog.imports_heading"), 2); // $NON-NLS-1$ fImportsTable = new Table(outer, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION); GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.heightHint = 150; fImportsTable.setLayoutData(gd); fImportsViewer = new TableViewer(fImportsTable); fImportsViewer.setLabelProvider(new FilterLabelProvider()); fImportsViewer.setComparator(new FilterViewerComparator()); fImportContentProvider = new ImportsContentProvider(fImportsViewer); fImportsViewer.setContentProvider(fImportContentProvider); // input just needs to be non-null fImportsViewer.setInput(this); fImportsViewer.addSelectionChangedListener( new ISelectionChangedListener() { @Override public void selectionChanged(SelectionChangedEvent event) { ISelection selection = event.getSelection(); if (selection.isEmpty()) { fRemoveImportsButton.setEnabled(false); } else { fRemoveImportsButton.setEnabled(true); } } }); createImportButtons(outer); applyDialogFont(outer); return parent; }
@Override protected Control createControl(Composite parent) { composite = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); layout.numColumns = 1; layout.horizontalSpacing = 0; layout.marginHeight = 0; layout.marginLeft = 0; layout.marginRight = 0; composite.setLayout(layout); // composite.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, true)); createStatusComposite(composite); return composite; }
private void createFilesArea(Composite parent, FormToolkit toolkit, int span) { Section files = createSection(parent, toolkit, span); Composite filesArea = createSectionClient(files, toolkit); GridLayout filesAreaLayout = (GridLayout) filesArea.getLayout(); filesAreaLayout.marginLeft = 0; filesAreaLayout.marginRight = 0; filesAreaLayout.marginTop = 0; filesAreaLayout.marginBottom = 0; CommitFileDiffViewer viewer = new CommitFileDiffViewer( filesArea, getSite(), SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | toolkit.getBorderStyle()); // commit file diff viewer uses a nested composite with a stack layout // and so margins need to be applied to have form toolkit style borders toolkit.paintBordersFor(viewer.getTable().getParent()); viewer.getTable().setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TREE_BORDER); StackLayout viewerLayout = (StackLayout) viewer.getControl().getParent().getLayout(); viewerLayout.marginHeight = 2; viewerLayout.marginWidth = 2; GridDataFactory.fillDefaults() .grab(true, true) .hint(SWT.DEFAULT, 80) .applyTo(viewer.getTable().getParent()); viewer.setContentProvider(ArrayContentProvider.getInstance()); viewer.setTreeWalk(getCommit().getRepository(), null); FileDiff[] diffs = getCommit().getDiffs(); viewer.setInput(diffs); files.setText( MessageFormat.format(UIText.CommitEditorPage_SectionFiles, Integer.valueOf(diffs.length))); updateSectionClient(files, filesArea, toolkit); }
/** * Create contents of the dialog. * * @param parent */ @Override protected Control createDialogArea(Composite parent) { Composite container = (Composite) super.createDialogArea(parent); GridLayout gl_container = new GridLayout(2, false); gl_container.marginRight = 5; gl_container.marginLeft = 10; container.setLayout(gl_container); Label lblUser = new Label(container, SWT.NONE); lblUser.setText("User:"******"Password:"******"Save credentials"); return container; }
/** Initialize the panel. */ private void init() { // ------------------------------ // Set layout for the SashForm // ------------------------------ GridLayout gridLayout = new GridLayout(); this.setLayout(gridLayout); gridLayout.numColumns = 1; gridLayout.marginLeft = 20; GridData gridData = new GridData(GridData.FILL_BOTH); this.setLayoutData(gridData); // Init the symbol arrays from bindings this.bindingList = createBindingList(originalBindingList); // ---------------------------------- // Create the Table Viewer Panel // ---------------------------------- createTableViewerPanel(this); // ------------------------------------------ // Create Attribute and SQL Control Panels // ------------------------------------------ createControlsPanel(this); // -------------------------------------------------- // Init the weighting for the top and bottom panels // -------------------------------------------------- int[] wts = {5, 8}; this.setWeights(wts); // Initialize the message area at the top of the dialog datatypeReconcilerDialog.setTitle(DIALOG_STATUS_TITLE); updateMessageArea(); // Listen for TableSelection from the Tables tableViewer.addSelectionChangedListener(this); selectFirstTypeConflict(); }
@Override public void initGraphicComponents() { mainComposite = new Composite(parentComposite, SWT.NONE); if (parentComposite.getBackground() != null && !parentComposite.getBackground().equals(mainComposite.getBackground())) { mainComposite.setBackground(parentComposite.getBackground()); } GridLayout layout = new GridLayout(); layout.marginLeft = 0; layout.marginRight = 0; layout.horizontalSpacing = 0; layout.marginTop = 0; layout.marginBottom = 0; layout.verticalSpacing = 0; layout.marginHeight = 0; layout.marginWidth = 0; mainComposite.setLayout(layout); GridData gridData = new GridData(GridData.FILL_BOTH); mainComposite.setLayoutData(gridData); initTable(); getExtendedTableViewer() .getTableViewerCreator() .getTableViewer() .setComparer(createElementComparer()); getExtendedTableViewer() .getTableViewerCreator() .getTable() .setLayoutData(new GridData(GridData.FILL_BOTH)); initToolBar(); addListeners(); }
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); }
protected void createFormContent(IManagedForm managedForm) { ScrolledForm form = managedForm.getForm(); FormToolkit toolkit = managedForm.getToolkit(); form.setText(Messages.getString("ScheduledTaskPage.sectionMainTitle")); form.setBackgroundImage(FormArticlePlugin.getDefault().getImage(FormArticlePlugin.IMG_FORM_BG)); GridLayout layout = new GridLayout(); layout.marginLeft = 20; layout.marginRight = 20; layout.marginTop = 10; layout.numColumns = 6; layout.makeColumnsEqualWidth = true; form.getBody().setLayout(layout); GridData formGridData = new GridData(); formGridData.horizontalSpan = 6; formGridData.grabExcessHorizontalSpace = true; form.setLayoutData(formGridData); createFormBasicSection(form, toolkit); createFormMiscSection(form, toolkit); createFormImplSection(form, toolkit); createFormTriggerSection(form, toolkit); }