/** * Sets the default visible item count for {@link Combo}s. * Workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=7845 . * * @param combo the combo * * @see Combo#setVisibleItemCount(int) * @see #COMBO_VISIBLE_ITEM_COUNT * * @since 3.5 */ public static void setDefaultVisibleItemCount(Combo combo) { combo.setVisibleItemCount(COMBO_VISIBLE_ITEM_COUNT); }
/** * Sets the default visible item count for {@link Combo}s. * Workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=7845 . * * @param combo the combo * * @see Combo#setVisibleItemCount(int) * @see #COMBO_VISIBLE_ITEM_COUNT * * @since 3.5 */ public static void setDefaultVisibleItemCount(Combo combo) { combo.setVisibleItemCount(COMBO_VISIBLE_ITEM_COUNT); } }
/** * Sets the default visible item count for {@link Combo}s. * Workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=7845 . * * @param combo the combo * * @see Combo#setVisibleItemCount(int) * @see #COMBO_VISIBLE_ITEM_COUNT * * @since 3.5 */ public static void setDefaultVisibleItemCount(Combo combo) { combo.setVisibleItemCount(COMBO_VISIBLE_ITEM_COUNT); } }
/** * Sets the default visible item count for {@link Combo}s. * Workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=7845 . * * @param combo the combo * * @see Combo#setVisibleItemCount(int) * @see #COMBO_VISIBLE_ITEM_COUNT * * @since 3.5 */ public static void setDefaultVisibleItemCount(Combo combo) { combo.setVisibleItemCount(COMBO_VISIBLE_ITEM_COUNT); }
public Combo newCombo(Composite parent) { Combo combo = new Combo(parent, SWT.DROP_DOWN | SWT.READ_ONLY | SWT.V_SCROLL | SWT.H_SCROLL); combo.setVisibleItemCount(20); return combo; }
public void setVisibleItemCount(int count) { if (combo instanceof Combo) ((Combo) combo).setVisibleItemCount(count); else ((CCombo) combo).setVisibleItemCount(count); } }
public void setEditable(boolean what) { editable_ = what; if (isUIAttached()) { updateErrorState(); if(control_ instanceof Combo) { int count = ((Combo)control_).getVisibleItemCount(); if(count>0){ visibleItemCount_ = count; } if(!editable_){ ((Combo)control_).setVisibleItemCount(0); }else { ((Combo)control_).setVisibleItemCount(visibleItemCount_); } } } }
/** * @see at.spardat.xma.mdl.UIDelegateClient#setEditable(boolean) */ public void setEditable (boolean what) { editable_ = what; if (isUIAttached()) { updateErrorState(); int count = combo_.getVisibleItemCount(); if(count>0){ visibleItemCount_ = count; } if(!editable_){ combo_.setVisibleItemCount(0); }else { combo_.setVisibleItemCount(visibleItemCount_); } } }
protected static Combo newCombo(Composite parent, String title, int combostyle) { if (title != null) { Label label = new Label(parent, SWT.NONE); label.setText(Translate.getInstance().labelName(title) + ": "); label.setFont(fonts.dialogFontBold()); label.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_CENTER | GridData.HORIZONTAL_ALIGN_BEGINNING)); } Combo combo = new Combo(parent, combostyle); combo.setFont(fonts.dialogFont()); combo.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL)); combo.setVisibleItemCount(20); setBG(combo); return combo; }
private Combo createIntermediaryTypeCombo(Composite composite) { final Combo textCombo= new Combo(composite, SWT.SINGLE | SWT.BORDER); textCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); textCombo.setItems(fgIntermediaryTypes.toArray(new String[fgIntermediaryTypes.size()])); textCombo.setVisibleItemCount(INTERMEDIARY_TYPE_COUNT); JavaTypeCompletionProcessor processor= new JavaTypeCompletionProcessor(false, false, true); processor.setPackageFragment(getIntroduceIndirectionRefactoring().getInvocationPackage()); ControlContentAssistHelper.createComboContentAssistant(textCombo, processor); TextFieldNavigationHandler.install(textCombo); return textCombo; }
protected Combo newLabeledCombo(Composite composite, String labelName, int style) { Label l = new Label(composite, SWT.NONE); l.setText(Translate.getInstance().labelName(labelName) + ": "); l.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING)); l.setFont(fonts.tableFontBold()); l.setBackground(bgColor); Combo combo = new Combo(composite, style); combo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); combo.setBackground(bgColor); combo.setVisibleItemCount(20); if (selectionListener != null) combo.addSelectionListener(selectionListener); if (keyListener != null) combo.addKeyListener(keyListener); return combo; }
private Combo createIntermediaryTypeCombo(Composite composite) { final Combo textCombo= new Combo(composite, SWT.SINGLE | SWT.BORDER); textCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); textCombo.setItems(fgIntermediaryTypes.toArray(new String[fgIntermediaryTypes.size()])); textCombo.setVisibleItemCount(INTERMEDIARY_TYPE_COUNT); JavaTypeCompletionProcessor processor= new JavaTypeCompletionProcessor(false, false, true); processor.setPackageFragment(getIntroduceIndirectionRefactoring().getInvocationPackage()); ControlContentAssistHelper.createComboContentAssistant(textCombo, processor); TextFieldNavigationHandler.install(textCombo); return textCombo; }
private Combo createIntermediaryTypeCombo(Composite composite) { final Combo textCombo= new Combo(composite, SWT.SINGLE | SWT.BORDER); textCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); textCombo.setItems((String[]) fgIntermediaryTypes.toArray(new String[fgIntermediaryTypes.size()])); textCombo.setVisibleItemCount(INTERMEDIARY_TYPE_COUNT); JavaTypeCompletionProcessor processor= new JavaTypeCompletionProcessor(false, false, true); processor.setPackageFragment(getIntroduceIndirectionRefactoring().getInvocationPackage()); ControlContentAssistHelper.createComboContentAssistant(textCombo, processor); TextFieldNavigationHandler.install(textCombo); return textCombo; }
/** * This method is used to make a combo box * @param parent the parent composite to add the new combo to * @param style the style for the Combo * @param hspan the horizontal span to take up on the parent composite * @param fill how the combo will fill into the composite * Can be one of <code>GridData.FILL_HORIZONAL</code>, <code>GridData.FILL_BOTH</code> or <code>GridData.FILL_VERTICAL</code> * @param items the item to put into the combo * @return a new Combo instance * @since 3.3 */ public static Combo createCombo(Composite parent, int style, int hspan, int fill, String[] items) { Combo c = new Combo(parent, style); c.setFont(parent.getFont()); GridData gd = new GridData(fill); gd.horizontalSpan = hspan; c.setLayoutData(gd); if (items != null){ c.setItems(items); } // Some platforms open up combos in bad sizes without this, see bug 245569 c.setVisibleItemCount(30); c.select(0); return c; }
/** * This method is used to make a combo box with a default fill style of GridData.FILL_HORIZONTAL * @param parent the parent composite to add the new combo to * @param style the style for the Combo * @param hspan the horizontal span to take up on the parent composite * @param items the item to put into the combo * @return a new Combo instance * @since 3.3 */ public static Combo createCombo(Composite parent, int style, int hspan, String[] items) { Combo c = new Combo(parent, style); c.setFont(parent.getFont()); GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = hspan; c.setLayoutData(gd); if (items != null){ c.setItems(items); } // Some platforms open up combos in bad sizes without this, see bug 245569 c.setVisibleItemCount(30); c.select(0); return c; }
/** * This method is used to make a combo box with a default fill style of GridData.FILL_HORIZONTAL * * @param parent the parent composite to add the new combo to * @param style the style for the Combo * @param hspan the horizontal span to take up on the parent composite * @param items the item to put into the combo * @return a new Combo instance */ public static Combo createCombo(Composite parent, int style, int hspan, String[] items) { Combo c = new Combo(parent, style); c.setFont(parent.getFont()); GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = hspan; c.setLayoutData(gd); if (items != null) { c.setItems(items); } // Some platforms open up combos in bad sizes without this, see bug 245569 c.setVisibleItemCount(30); c.select(0); return c; }
/** * This method is used to make a combo box * * @param parent the parent composite to add the new combo to * @param style the style for the Combo * @param hspan the horizontal span to take up on the parent composite * @param fill how the combo will fill into the composite * Can be one of <code>GridData.FILL_HORIZONAL</code>, <code>GridData.FILL_BOTH</code> or <code>GridData.FILL_VERTICAL</code> * @param items the item to put into the combo * @return a new Combo instance */ public static Combo createCombo(Composite parent, int style, int hspan, int fill, String[] items) { Combo c = new Combo(parent, style); c.setFont(parent.getFont()); GridData gd = new GridData(fill); gd.horizontalSpan = hspan; c.setLayoutData(gd); if (items != null) { c.setItems(items); } // Some platforms open up combos in bad sizes without this, see bug 245569 c.setVisibleItemCount(30); c.select(0); return c; }
c.setVisibleItemCount(30); c.select(0); return c;
c.setVisibleItemCount(30); c.select(0); return c;
protected Combo newComboControl(Composite composite, String key, String[] values, String[] valueLabels) { ControlData data = new ControlData(key, values); Combo comboBox = new Combo(composite, SWT.READ_ONLY); comboBox.setItems(valueLabels); comboBox.setData(data); comboBox.addSelectionListener(getSelectionListener()); comboBox.setFont(JFaceResources.getDialogFont()); comboBox.setVisibleItemCount(30); makeScrollableCompositeAware(comboBox); updateCombo(comboBox); comboBoxes.add(comboBox); return comboBox; }