private Color getHoverBackground() { if (hoverState == STATE_NORMAL) return null; Color color = getColor(hoverState == STATE_HOVER_FULL ? IFormColors.H_HOVER_FULL : IFormColors.H_HOVER_LIGHT); if (color == null) color = getDisplay() .getSystemColor( hoverState == STATE_HOVER_FULL ? SWT.COLOR_WIDGET_BACKGROUND : SWT.COLOR_WIDGET_LIGHT_SHADOW); return color; }
public void setHoverState(int state) { if (dragSource == null || this.hoverState == state) return; this.hoverState = state; Color color = getHoverBackground(); titleLabel.setBackground(color != null ? color : getColor(FormHeading.COLOR_BASE_BG)); if (busyLabel != null) busyLabel.setBackground(color != null ? color : getColor(FormHeading.COLOR_BASE_BG)); if (menuHyperlink != null) menuHyperlink.setBackground(color != null ? color : getColor(FormHeading.COLOR_BASE_BG)); redraw(); }
public void setHoverState(int state) { if (dragSource == null || this.hoverState == state) return; this.hoverState = state; Color color = getHoverBackground(); titleLabel.setBackground(color != null ? color : getColor(FormHeading.COLOR_BASE_BG)); if (busyLabel != null) busyLabel.setBackground(color != null ? color : getColor(FormHeading.COLOR_BASE_BG)); if (menuHyperlink != null) menuHyperlink.setBackground(color != null ? color : getColor(FormHeading.COLOR_BASE_BG)); redraw(); }
private Color getHoverBackground() { if (hoverState == STATE_NORMAL) return null; Color color = getColor(hoverState == STATE_HOVER_FULL ? IFormColors.H_HOVER_FULL : IFormColors.H_HOVER_LIGHT); if (color == null) color = getDisplay() .getSystemColor( hoverState == STATE_HOVER_FULL ? SWT.COLOR_WIDGET_BACKGROUND : SWT.COLOR_WIDGET_LIGHT_SHADOW); return color; }
private void createMenuHyperlink() { menuHyperlink = new MenuHyperlink(this, SWT.NULL); menuHyperlink.setBackground(getColor(FormHeading.COLOR_BASE_BG)); menuHyperlink.setDecorationColor(getForeground()); menuHyperlink.setHoverDecorationColor(getDisplay().getSystemColor(SWT.COLOR_LIST_FOREGROUND)); HoverListener listener = new HoverListener(); menuHyperlink.addMouseTrackListener(listener); menuHyperlink.addMouseMoveListener(listener); if (dragSupport) addDragSupport(menuHyperlink, dragOperations, dragTransferTypes, dragListener); }
private void createMenuHyperlink() { menuHyperlink = new MenuHyperlink(this, SWT.NULL); menuHyperlink.setBackground(getColor(FormHeading.COLOR_BASE_BG)); menuHyperlink.setDecorationColor(getForeground()); menuHyperlink.setHoverDecorationColor(getDisplay().getSystemColor(SWT.COLOR_LIST_FOREGROUND)); HoverListener listener = new HoverListener(); menuHyperlink.addMouseTrackListener(listener); menuHyperlink.addMouseMoveListener(listener); if (dragSupport) addDragSupport(menuHyperlink, dragOperations, dragTransferTypes, dragListener); }
private void ensureBusyLabelExists() { if (busyLabel == null) { busyLabel = new BusyIndicator(this, SWT.NULL); busyLabel.setBackground(getColor(FormHeading.COLOR_BASE_BG)); HoverListener listener = new HoverListener(); busyLabel.addMouseTrackListener(listener); busyLabel.addMouseMoveListener(listener); if (menuManager != null) busyLabel.setMenu(menuManager.createContextMenu(this)); if (dragSupport) addDragSupport(busyLabel, dragOperations, dragTransferTypes, dragListener); IMessageToolTipManager mng = ((FormHeading) getParent()) .getMessageToolTipManager(); if (mng != null) mng.createToolTip(busyLabel, true); } }
private void ensureBusyLabelExists() { if (busyLabel == null) { busyLabel = new BusyIndicator(this, SWT.NULL); busyLabel.setBackground(getColor(FormHeading.COLOR_BASE_BG)); HoverListener listener = new HoverListener(); busyLabel.addMouseTrackListener(listener); busyLabel.addMouseMoveListener(listener); if (menuManager != null) busyLabel.setMenu(menuManager.createContextMenu(this)); if (dragSupport) addDragSupport(busyLabel, dragOperations, dragTransferTypes, dragListener); IMessageToolTipManager mng = ((FormHeading) getParent()) .getMessageToolTipManager(); if (mng != null) mng.createToolTip(busyLabel, true); } }