Package org.eclipse.ui.internal.forms.widgets

Examples of org.eclipse.ui.internal.forms.widgets.FormHeading$GradientInfo


   *            the parent widget
   */
  public Form(Composite parent, int style) {
    super(parent, SWT.NO_BACKGROUND | style);
    super.setLayout(new FormLayout());
    head = new FormHeading(this, SWT.NULL);
    head.setMenu(parent.getMenu());
    body = new LayoutComposite(this, SWT.NULL);
    body.setMenu(parent.getMenu());
  }
View Full Code Here


   *            the parent widget
   */
  public Form(Composite parent, int style) {
    super(parent, SWT.NO_BACKGROUND | style);
    super.setLayout(new FormLayout());
    head = new FormHeading(this, SWT.NULL);
    head.setMenu(parent.getMenu());
    body = new LayoutComposite(this, SWT.NULL);
    body.setMenu(parent.getMenu());
  }
View Full Code Here

  @Override
  public void createPartControl(Composite parent)
  {
    final Composite main = new Composite( parent, SWT.NONE );
    main.setLayout(new FormLayout());
    this.header = new FormHeading(main, SWT.NULL);
    this.formColors = new FormColors(parent.getDisplay());
           
    super.createPartControl(main);
    this.body = getGraphicalControl().getParent();
  }
View Full Code Here

   * @param sha1String
   *            string form of the SHA-1, in lower case hexadecimal
   */
  public HeaderText(Form form, String text, String sha1String) {
    try {
      FormHeading heading = (FormHeading) form.getHead();
      heading.setBusy(true);
      heading.setBusy(false);

      Field field = FormHeading.class.getDeclaredField("titleRegion"); //$NON-NLS-1$
      field.setAccessible(true);
      TitleRegion titleRegion = (TitleRegion) field.get(heading);

      for (Control child : titleRegion.getChildren())
        if (child instanceof BusyIndicator) {
          busyLabel = (BusyIndicator) child;
          break;
        }
      if (busyLabel == null)
        throw new IllegalArgumentException();

      final TextViewer titleViewer = new TextViewer(titleRegion, SWT.READ_ONLY);
      titleViewer.setDocument(new Document(text));

      titleLabel = titleViewer.getTextWidget();
      titleLabel.setForeground(heading.getForeground());
      titleLabel.setFont(heading.getFont());
      titleLabel.addFocusListener(new FocusAdapter() {
        public void focusLost(FocusEvent e) {
          titleLabel.setSelection(0);
          Event selectionEvent= new Event();
          selectionEvent.x = 0;
          selectionEvent.y = 0;
          titleLabel.notifyListeners(SWT.Selection, selectionEvent);
        }
      });
      createContextMenu(titleLabel, sha1String);

      Point size = titleLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT);
      Image emptyImage = new Image(heading.getDisplay(), size.x, size.y);
      UIUtils.hookDisposal(titleLabel, emptyImage);
      busyLabel.setImage(emptyImage);

      busyLabel.addControlListener(new ControlAdapter() {
        public void controlMoved(ControlEvent e) {
View Full Code Here

TOP

Related Classes of org.eclipse.ui.internal.forms.widgets.FormHeading$GradientInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.