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

Examples of org.eclipse.ui.internal.forms.widgets.TitleRegion


      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) {
          updateSizeAndLocations();
        }
      });
      titleLabel.moveAbove(busyLabel);
      titleRegion.addControlListener(new ControlAdapter() {
        public void controlResized(ControlEvent e) {
          updateSizeAndLocations();
        }
      });
      updateSizeAndLocations();
View Full Code Here

TOP

Related Classes of org.eclipse.ui.internal.forms.widgets.TitleRegion

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.