protected static SIcon getIcon(SClickable abstractButton) { if (abstractButton.isSelected()) { return abstractButton.isEnabled() ? abstractButton.getSelectedIcon() : abstractButton.getDisabledSelectedIcon(); } else { return abstractButton.isEnabled() ? abstractButton.getIcon() : abstractButton.getDisabledIcon(); } }
protected static void tableAttributes(Device device, SClickable button) throws IOException { Utils.printClickability(device, button, button.getEvent(), true, button.getShowAsFormComponent()); Utils.writeAllAttributes(device, button); if (button.isFocusOwner()) Utils.optAttribute(device, "foc", button.getName()); Utils.optAttribute(device, "tabindex", button.getFocusTraversalIndex()); }
final SClickable button = (SClickable) component; final String text = button.getText(); final SIcon icon = getIcon(button); ClickableCG.tableAttributes(d, button); }.writeCompound(device, component, button.getHorizontalTextPosition(), button.getVerticalTextPosition(), false);
@Override public SimpleURL getURL() { if (event != null && requestTarget != null) { RequestURL u = getRequestURL(); if (!isEpochCheckEnabled()) { u.setEventEpoch(null); u.setResource(null); } u.addParameter(requestTarget, event); return u; } else { return null; } }
/** * Creates a scrollbar with the specified orientation, * value, extent, mimimum, and maximum. * The "extent" is the size of the viewable area. It is also known * as the "visible amount". * * @throws IllegalArgumentException if orientation is not one of VERTICAL, HORIZONTAL * @see #setOrientation * @see #setValue * @see #setVisibleAmount * @see #setMinimum * @see #setMaximum */ public SPageScroller(int orientation, int value, int extent, int min, int max) { super(new SPagingBoundedRangeModel(value, extent, min, max)); unitIncrement = extent; blockIncrement = extent; for (int i = 0; i < clickables.length; i++) { clickables[i] = new SClickable(); clickables[i].setEventTarget(this); } setOrientation(orientation); setMarginVisible(false); setHorizontalAlignment(SConstants.CENTER); setVerticalAlignment(SConstants.CENTER); setEpochCheckEnabled(false); }
/** * Returns the according event ID for the given component. */ public static String event(SComponent component) { if (component instanceof SClickable) return ((SClickable)component).getEventTarget().getLowLevelEventId(); else return component.getLowLevelEventId(); }
/** * Initialize the DefaultCellEditor with an editor component (like an text * field for instance). After calling this constructor, the * {@link EditorDelegate}, that links the CellEditor and the * editorComponent has to be passed to the delegate instance variable. * * @param editorComponent the component used * @param initializeButtons flag to indicate if the button texts and icons * should be initialized. */ protected SDefaultCellEditor(SComponent editorComponent, boolean initializeButtons) { this.messageLabel = new SLabel(); this.editorPanel = new EditorPanel(); this.ok = new SClickable(); this.cancel = new SClickable(); this.listenerList = new EventListenerList(); this.editorComponent = editorComponent; editorPanel.add(messageLabel); editorPanel.add(editorComponent); if (initializeButtons) { initButtons(); } }