Пример #1
0
  @Override
  public void updateLabel() {
    ISearchResultPage page = getActivePage();
    String label = ""; // $NON-NLS-1$
    if (page != null) {
      label = LegacyActionTools.escapeMnemonics(page.getLabel());
    }
    if (!fPageContent.isDisposed()) {
      if (label.length() == 0) {
        if (fDescriptionComposite != null) {
          fDescriptionComposite.dispose();
          fDescriptionComposite = null;
          fPageContent.layout();
        }
      } else {
        if (fDescriptionComposite == null) {
          fDescriptionComposite = new Composite(fPageContent, SWT.NONE);
          fDescriptionComposite.moveAbove(null);

          GridLayout layout = new GridLayout();
          layout.marginHeight = 0;
          layout.marginWidth = 0;
          layout.verticalSpacing = 0;
          fDescriptionComposite.setLayout(layout);
          fDescriptionComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));

          fDescription = new Link(fDescriptionComposite, SWT.NONE);
          GridData gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
          gridData.horizontalIndent = 5;
          fDescription.setLayoutData(gridData);
          fDescription.setText(label);

          Label separator = new Label(fDescriptionComposite, SWT.SEPARATOR | SWT.HORIZONTAL);
          separator.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
          fPageContent.layout();
        } else {
          fDescription.setText(label);
        }
      }
    }
  }