protected void restoreSectionExpansionStates(IDialogSettings settings) { for (int i= 0; i < fExpandableComposites.size(); i++) { ExpandableComposite excomposite= fExpandableComposites.get(i); if (settings == null) { excomposite.setExpanded(i == 0); // only expand the first node by default } else { excomposite.setExpanded(settings.getBoolean(SETTINGS_EXPANDED + String.valueOf(i))); } } }
protected void restoreSectionExpansionStates(IDialogSettings settings) { for (int i = 0; i < expandedComposites.size(); i++) { ExpandableComposite excomposite = expandedComposites.get(i); if (settings == null) { excomposite.setExpanded(i == 0); // only expand the first node by default } else { excomposite.setExpanded(settings.getBoolean(SETTINGS_EXPANDED + String.valueOf(i))); } } }
protected void restoreSectionExpansionStates(IDialogSettings settings) { for (int i= 0; i < fExpandedComposites.size(); i++) { ExpandableComposite excomposite= (ExpandableComposite) fExpandedComposites.get(i); if (settings == null) { excomposite.setExpanded(i == 0); // only expand the first node by default } else { excomposite.setExpanded(settings.getBoolean(SETTINGS_EXPANDED + String.valueOf(i))); } } }
protected void restoreSectionExpansionStates(IDialogSettings settings) { for (int i= 0; i < fExpandedComposites.size(); i++) { ExpandableComposite excomposite= (ExpandableComposite) fExpandedComposites.get(i); if (settings == null) { excomposite.setExpanded(i == 0); // only expand the first node by default } else { excomposite.setExpanded(settings.getBoolean(SETTINGS_EXPANDED + String.valueOf(i))); } } }
protected void restoreSectionExpansionStates(IDialogSettings settings) { for (int i= 0; i < fExpandableComposites.size(); i++) { ExpandableComposite excomposite= fExpandableComposites.get(i); if (settings == null) { excomposite.setExpanded(i == 0); // only expand the first node by default } else { excomposite.setExpanded(settings.getBoolean(SETTINGS_EXPANDED + String.valueOf(i))); } } }
/** * restore the expansion state */ private void restoreExpansionState() { IPreferenceStore store = getPreferenceStore(); if(store == null) { ((ExpandableComposite)fExpandedComps.get(0)).setExpanded(true); } else { ExpandableComposite ex; for (int i = 0; i < fExpandedComps.size(); i++) { ex = (ExpandableComposite) fExpandedComps.get(i); ex.setExpanded(store.getBoolean(EXPANDED_STATE+i)); } } }
/** * Restores the expansion state of the composites in this block. * If there are no settings, than the first composite is expanded by default */ private void restoreExpansionState() { IDialogSettings settings = ApiUIPlugin.getDefault().getDialogSettings().getSection(SETTINGS); if(settings != null) { for(int i = 0; i < fExpComps.size(); i++) { ((ExpandableComposite) fExpComps.get(i)).setExpanded(settings.getBoolean(Integer.toString(i))); } } else { ((ExpandableComposite)fExpComps.get(0)).setExpanded(true); } }
/** * Restores the expansion state of the composites in this block. * If there are no settings, than the first composite is expanded by default */ private void restoreExpansionState() { IDialogSettings settings = PDEPlugin.getDefault().getDialogSettings().getSection(SETTINGS); if (settings != null) { for (int i = 0; i < fExpComps.size(); i++) { fExpComps.get(i).setExpanded(settings.getBoolean(Integer.toString(i))); } } else { fExpComps.get(0).setExpanded(true); } }
/** * Restores the expansion state of the composites in this block. If there * are no settings, than the first composite is expanded by default */ private void restoreExpansionState() { IDialogSettings settings = ApiUIPlugin.getDefault().getDialogSettings().getSection(SETTINGS); if (settings != null) { for (int i = 0; i < fExpComps.size(); i++) { fExpComps.get(i).setExpanded(settings.getBoolean(Integer.toString(i))); } } else { fExpComps.get(0).setExpanded(true); } }
public void selectOption(Key key) { Control control= findControl(key); if (control != null) { if (!fExpandableComposites.isEmpty()) { ExpandableComposite expandable= getParentExpandableComposite(control); if (expandable != null) { for (int i= 0; i < fExpandableComposites.size(); i++) { ExpandableComposite curr= fExpandableComposites.get(i); curr.setExpanded(curr == expandable); } expandedStateChanged(expandable); } } control.setFocus(); } }
public void selectOption(Key key) { Control control= findControl(key); if (control != null) { if (!fExpandedComposites.isEmpty()) { ExpandableComposite expandable= getParentExpandableComposite(control); if (expandable != null) { for (int i= 0; i < fExpandedComposites.size(); i++) { ExpandableComposite curr= (ExpandableComposite) fExpandedComposites.get(i); curr.setExpanded(curr == expandable); } expandedStateChanged(expandable); } } control.setFocus(); } }
private void readExpansionState(PreferenceTreeNode<?> node, InputStream in) throws IOException { for (PreferenceTreeNode<?> child : node.getChildren()) { if (child instanceof Section) { int state= in.read(); ((Section) child).getControl().setExpanded(state == '1'); readExpansionState(child, in); if (state == '.' || state == -1) return; // some nodes missing in stored tree } } int c= in.read(); while (c != '.' && c != -1) { // some extra nodes in stored tree readExpansionState(new PreferenceTreeNode<>(null, null, false), in); c= in.read(); } }
protected void setAllExpanded(PreferenceTreeNode<?> start, boolean expanded) { fScrolledPageContent.setRedraw(false); fScrolledPageContent.setReflow(false); ArrayList<PreferenceTreeNode<?>> bfsNodes= new ArrayList<>(); if (start != null) { bfsNodes.add(start); } else { bfsNodes.addAll(fRoot.getChildren()); } for (int i= 0; i < bfsNodes.size(); i++) { PreferenceTreeNode<?> node= bfsNodes.get(i); bfsNodes.addAll(bfsNodes.get(i).getChildren()); if (node.getControl() instanceof ExpandableComposite) ((ExpandableComposite) node.getControl()).setExpanded(expanded); } fScrolledPageContent.setReflow(true); Display.getCurrent().asyncExec(() -> fScrolledPageContent.setRedraw(true)); }
public static Section create(Composite parentComposite, String label, String previewKey) { final ExpandableComposite excomposite= new FormatterPreferenceSectionComposite(parentComposite, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT); excomposite.clientVerticalSpacing= 0; excomposite.setText(label); excomposite.setExpanded(false); excomposite.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT)); excomposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, GRID_COLUMNS, 1)); Composite inner= new Composite(excomposite, SWT.NONE); inner.setFont(parentComposite.getFont()); GridLayout layout= new GridLayout(GRID_COLUMNS, false); layout.marginWidth= 0; layout.marginLeft= 5; inner.setLayout(layout); excomposite.setClient(inner); return new Section(label, excomposite, inner, previewKey); }
public void setExpanded() { if (!mainItemComposite.isExpanded()) { mainItemComposite.setExpanded(true); if(initialized) { page.getForm().reflow(true); FormToolkit.ensureVisible(getMainItemComposite()); } } }
void setCollapsed() { if (mainItemComposite.isExpanded()) { mainItemComposite.setExpanded(false); if(initialized) { page.getForm().reflow(true); FormToolkit.ensureVisible(getMainItemComposite()); } } }
protected ExpandableComposite createStyleSection(Composite parent, String label, int nColumns) { ExpandableComposite excomposite= new ExpandableComposite(parent, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT); excomposite.setText(label); excomposite.setExpanded(false); excomposite.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT)); excomposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, nColumns, 1)); excomposite.addExpansionListener(new ExpansionAdapter() { public void expansionStateChanged(ExpansionEvent e) { expandedStateChanged((ExpandableComposite) e.getSource()); } }); fExpandedComposites.add(excomposite); makeScrollableCompositeAware(excomposite); return excomposite; }
protected ExpandableComposite createStyleSection(Composite parent, String label, int nColumns) { ExpandableComposite excomposite = new ExpandableComposite(parent, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT); excomposite.setText(label); excomposite.setExpanded(false); excomposite.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT)); excomposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, nColumns, 1)); excomposite.addExpansionListener(new ExpansionAdapter() { @Override public void expansionStateChanged(ExpansionEvent e) { expandedStateChanged((ExpandableComposite) e.getSource()); } }); expandedComposites.add(excomposite); makeScrollableCompositeAware(excomposite); return excomposite; }
protected ExpandableComposite createStyleSection(Composite parent, String label, int nColumns, Key key) { ExpandableComposite excomposite= new ExpandableComposite(parent, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT); excomposite.setText(label); if (key != null) { excomposite.setData(key); } excomposite.setExpanded(false); excomposite.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT)); excomposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, nColumns, 1)); excomposite.addExpansionListener(new ExpansionAdapter() { @Override public void expansionStateChanged(ExpansionEvent e) { expandedStateChanged((ExpandableComposite) e.getSource()); } }); fExpandableComposites.add(excomposite); makeScrollableCompositeAware(excomposite); return excomposite; }
private void restoreWidgetValues() { IDialogSettings dialogSettings = CompareUI.getPlugin().getDialogSettings(); settings = dialogSettings.getSection(PREVIEWPATCHPAGE_NAME); if (settings == null) { settings = dialogSettings.addNewSection(PREVIEWPATCHPAGE_NAME); } if (settings != null) { if (settings.get(EXPAND_PATCH_OPTIONS) != null) patchOptions.setExpanded(settings.getBoolean(EXPAND_PATCH_OPTIONS)); if (settings.get(GENERATE_REJECTS) != null) { generateRejects.setSelection(settings.getBoolean(GENERATE_REJECTS)); getPatcher().setGenerateRejectFile(generateRejects.getSelection()); } } }