fComposite= new Splitter(parent, SWT.VERTICAL); fComposite.setData(this); fFocusPane= fContentInputPane; if (outline != null) fComposite.setVisible(outline, false); fComposite.setVisible(fContentInputPane, true); fComposite.setWeights(new int[] { 30, 70 }); fComposite.layout(); fComposite.addDisposeListener(new DisposeListener() { public void widgetDisposed(DisposeEvent e) { handleDispose();
@Override public void setMaximizedControl(Control control) { if (control == null || control == getMaximizedControl()) super.setMaximizedControl(null); else super.setMaximizedControl(control); // recursively walk upward Composite parent= getParent(); if (parent instanceof Splitter) ((Splitter) parent).setMaximizedControl(this); layout(true); }
private boolean isEmpty() { Control[] controls= getChildren(); for (int i= 0; i < controls.length; i++) if (isVisible(controls[i])) return false; return true; }
/** * Sets the visibility of the given child in this Splitter. If this change * affects the visibility state of the whole Splitter, and if the Splitter * is directly nested in one or more Splitters, this method recursively * propagates the new state upward. * * @param child the child control for which the visibility is changed * @param visible the new visibility state */ public void setVisible(Control child, boolean visible) { boolean wasEmpty= isEmpty(); child.setVisible(visible); child.setData(VISIBILITY, Boolean.valueOf(visible)); if (wasEmpty != isEmpty()) { // recursively walk up Composite parent= getParent(); if (parent instanceof Splitter) { Splitter sp= (Splitter) parent; sp.setVisible(this, visible); sp.layout(); } } else { layout(); } }
org.eclipse.compare.Splitter vsplitter= new org.eclipse.compare.Splitter(parent, SWT.VERTICAL); vsplitter.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL | GridData.GRAB_VERTICAL)); vsplitter.addDisposeListener( new DisposeListener() { public void widgetDisposed(DisposeEvent e) { Splitter hsplitter= new Splitter(vsplitter, SWT.HORIZONTAL); vsplitter.setWeights(new int[] { 30, 70 });
Splitter vsplitter = new Splitter(composite, SWT.VERTICAL); vsplitter.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL | GridData.GRAB_VERTICAL)); Splitter hsplitter = new Splitter(vsplitter, SWT.HORIZONTAL); fEditionPane = new CompareViewerPane(hsplitter, SWT.BORDER | SWT.FLAT); fStructuredComparePane = new CompareViewerSwitchingPane(hsplitter, SWT.BORDER | SWT.FLAT, true) { vsplitter.setWeights(new int[]{30, 70}); hsplitter.setMaximizedControl(fEditionPane);
fComposite= new Splitter(parent, SWT.VERTICAL); fComposite.setData(this); fFocusPane= fContentInputPane; if (outline != null) fComposite.setVisible(outline, false); fComposite.setVisible(fContentInputPane, true); if (fStructureInputPane != null && fComposite.getChildren().length == 2) fComposite.setWeights(new int[] { 30, 70 }); fComposite.addDisposeListener(e -> {
setLayout(layout); setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL)); fSplitterControl= new Splitter(this, SWT.VERTICAL); fSplitterControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL)); createRightButtonBar(this); final Composite leftPane= new Composite(fSplitterControl, SWT.NONE); addMouseListener(listener); fHistoryPane.getTopLeft().addMouseListener(listener); fSplitterControl.setWeights(new int[] { 65, 35}); createBottomButtonBar(this); Dialog.applyDialogFont(this);
public void createControl(Composite parent) { final Splitter h= new Splitter(parent, SWT.HORIZONTAL); fStructurePane= new CompareViewerSwitchingPane(h, SWT.BORDER | SWT.FLAT, true) { protected Viewer getViewer(Viewer oldViewer, Object input) { if (input instanceof ICompareInput) return findStructureViewer(oldViewer, (ICompareInput)input, this); return null; } }; h.setVisible(fStructurePane, true); fControl = h; IPageSite site = getSite(); site.setSelectionProvider(fStructurePane); h.layout(); reset(); }
final Splitter h= new Splitter(parent, direction); h.setVisible(fStructurePane1, false); h.setVisible(fStructurePane2, false);
public void setInput(Object input) { super.setInput(input); Composite c = getParent(); if (c instanceof Splitter) ((Splitter)c).setVisible(this, true); layout(true); } };
@Override public void mouseDoubleClick(MouseEvent e) { Control content= getContent(); if (content != null && content.getBounds().contains(e.x, e.y)) return; Control parent= getParent(); if (parent instanceof Splitter) ((Splitter)parent).setMaximizedControl(CompareViewerPane.this); } };
private void feedDefault1(final ISelection selection) { BusyIndicator.showWhile(fComposite.getDisplay(), new Runnable() { public void run() { if (!selection.isEmpty()) fStructurePane1.setInput(getElement(selection)); } } ); }
org.eclipse.compare.Splitter vsplitter= new org.eclipse.compare.Splitter(parent, SWT.VERTICAL); vsplitter.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL | GridData.GRAB_VERTICAL)); vsplitter.addDisposeListener( e -> { if (fDateImage != null) Splitter hsplitter= new Splitter(vsplitter, SWT.HORIZONTAL); vsplitter.setWeights(new int[] { 30, 70 });
Splitter vsplitter = new Splitter(composite, SWT.VERTICAL); vsplitter.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL | GridData.GRAB_VERTICAL)); Splitter hsplitter = new Splitter(vsplitter, SWT.HORIZONTAL); fEditionPane = new CompareViewerPane(hsplitter, SWT.BORDER | SWT.FLAT); fStructuredComparePane = new CompareViewerSwitchingPane(hsplitter, SWT.BORDER | SWT.FLAT, true) { vsplitter.setWeights(new int[]{30, 70}); hsplitter.setMaximizedControl(fEditionPane);
@Override public void createControl(Composite parent) { final Splitter h= new Splitter(parent, SWT.HORIZONTAL); fStructurePane= new CompareViewerSwitchingPane(h, SWT.BORDER | SWT.FLAT, true) { @Override protected Viewer getViewer(Viewer oldViewer, Object input) { if (input instanceof ICompareInput) return findStructureViewer(oldViewer, (ICompareInput)input, this); return null; } }; h.setVisible(fStructurePane, true); fControl = h; IPageSite site = getSite(); site.setSelectionProvider(fStructurePane); h.layout(); reset(); }
/** * Sets the visibility of the given child in this Splitter. If this change * affects the visibility state of the whole Splitter, and if the Splitter * is directly nested in one or more Splitters, this method recursively * propagates the new state upward. * * @param child the child control for which the visibility is changed * @param visible the new visibility state */ public void setVisible(Control child, boolean visible) { boolean wasEmpty= isEmpty(); child.setVisible(visible); child.setData(VISIBILITY, new Boolean(visible)); if (wasEmpty != isEmpty()) { // recursively walk up Composite parent= getParent(); if (parent instanceof Splitter) { Splitter sp= (Splitter) parent; sp.setVisible(this, visible); sp.layout(); } } else { layout(); } }
final Splitter h= new Splitter(parent, direction); h.setVisible(fStructurePane1, false); h.setVisible(fStructurePane2, false);
@Override public void setInput(Object input) { super.setInput(input); Composite c = getParent(); if (c instanceof Splitter) ((Splitter)c).setVisible(this, true); layout(true); } };
public void mouseDoubleClick(MouseEvent e) { Control content= getContent(); if (content != null && content.getBounds().contains(e.x, e.y)) return; Control parent= getParent(); if (parent instanceof Splitter) ((Splitter)parent).setMaximizedControl(CompareViewerPane.this); } };