Package org.eclipse.jface.viewers

Examples of org.eclipse.jface.viewers.ILabelProvider


    return;
  }

  private IJavaProject chooseJavaProject() {
    ILabelProvider labelProvider = new JavaElementLabelProvider(
        JavaElementLabelProvider.SHOW_DEFAULT);
    ElementListSelectionDialog dialog = new ElementListSelectionDialog(
        getShell(), labelProvider);
    dialog.setTitle("Project Selection");
    dialog.setMessage("Select a project to constrain your search.");
View Full Code Here


    return;
  }

  private IJavaProject chooseJavaProject() {
    ILabelProvider labelProvider = new JavaElementLabelProvider(
        JavaElementLabelProvider.SHOW_DEFAULT);
    ElementListSelectionDialog dialog = new ElementListSelectionDialog(
        getShell(), labelProvider);
    dialog.setTitle("Project Selection");
    dialog.setMessage("Select a project to constrain your search.");
View Full Code Here

    return;
  }

  private IJavaProject chooseJavaProject() {
    ILabelProvider labelProvider = new JavaElementLabelProvider(
        JavaElementLabelProvider.SHOW_DEFAULT);
    ElementListSelectionDialog dialog = new ElementListSelectionDialog(
        getShell(), labelProvider);
    dialog.setTitle("Project Selection");
    dialog.setMessage("Select a project to constrain your search.");
View Full Code Here

                name2 = e2.toString();
            } else {
                IBaseLabelProvider prov = ((ContentViewer) viewer)
                        .getLabelProvider();
                if (prov instanceof ILabelProvider) {
                    ILabelProvider lprov = (ILabelProvider) prov;
                    name1 = lprov.getText(e1);
                    name2 = lprov.getText(e2);
                    // ILabelProvider's implementation in BasicStackList calls
                    // DefaultEditorPresentation.getLabelText which returns the name of dirty
                    // files begining with dirty prefix, sorting should not take dirty prefix in consideration
                    String prefix = DefaultTabItem.DIRTY_PREFIX;
                    if (name1.startsWith(prefix)) {
View Full Code Here

                if (orientation == SWT.VERTICAL) {
                  transform = new Transform(event.display);
                transform.translate(TrimUtil.TRIM_DEFAULT_HEIGHT, 0);
                transform.rotate(90);
                }
                ILabelProvider labelProvider = (ILabelProvider) getLabelProvider();

                int itemCount = Math.min(displayedItems.length, numShowItems);

                int yOffset = 0;
                int xOffset = 0;
                if (numShowItems == 1) {//If there is a single item try to center it
                    Rectangle clientArea = canvas.getParent().getClientArea();
                    if (orientation == SWT.HORIZONTAL) {
                      int size = clientArea.height;
                      yOffset = size - (fontMetrics.getHeight());
                      yOffset = yOffset / 2;
                    } else {
                      int size = clientArea.width;
                      xOffset = size - (fontMetrics.getHeight());
                      xOffset = xOffset / 2;
                    }
                }

                for (int i = 0; i < itemCount; i++) {
                    String string = labelProvider.getText(displayedItems[i]);
                    if(string == null) {
            string = "";//$NON-NLS-1$
          }
                    if (orientation == SWT.HORIZONTAL) {
                      gc.drawString(string, 2, yOffset + (i * fontMetrics.getHeight()), true);
View Full Code Here

   * configurations.
   *
   * @return the chosen config, or <code>null</code> if the user cancelled the dialog.
   */
  private static ILaunchConfiguration chooseConfiguration(List<ILaunchConfiguration> configurations) {
    ILabelProvider labelProvider = DebugUITools.newDebugModelPresentation();
    //
    ElementListSelectionDialog dialog =
        new ElementListSelectionDialog(DesignerPlugin.getShell(), labelProvider);
    dialog.setElements(configurations.toArray());
    dialog.setTitle("Select GWT application");
    dialog.setMessage("&Select existing configuration:");
    dialog.setMultipleSelection(false);
    //
    int result = dialog.open();
    labelProvider.dispose();
    if (result == Window.OK) {
      return (ILaunchConfiguration) dialog.getFirstResult();
    }
    return null;
  }
View Full Code Here

    /**
     * Choose GWT project using dialog.
     */
    private void chooseProject() {
      // prepare dialog
      ILabelProvider labelProvider =
          new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT);
      ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), labelProvider);
      dialog.setTitle("Project Selection");
      dialog.setMessage("Select a GWT project:");
      // set elements
View Full Code Here

    /**
     * Choose GWT project using dialog.
     */
    private void chooseProject() {
      // prepare dialog
      ILabelProvider labelProvider =
          new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT);
      ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), labelProvider);
      dialog.setTitle("Project Selection");
      dialog.setMessage("Select a GWT project:");
      // set elements
View Full Code Here

      IJavaProject javaProject = getProject();
      if (javaProject == null) {
        return;
      }
      // prepare dialog
      ILabelProvider labelProvider = GwtLabelProvider.INSTANCE;
      ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), labelProvider);
      dialog.setTitle("Module Selection");
      dialog.setMessage("Select a GWT module:");
      // set elements
      try {
View Full Code Here

      fTableViewer.setSelection(StructuredSelection.EMPTY);
    }
    }

    private Object findElement(TableItem[] items) {
        ILabelProvider labelProvider = (ILabelProvider) fTableViewer
                .getLabelProvider();
        for (int i = 0; i < items.length; i++) {
            Object element = items[i].getData();
            if (fStringMatcher == null) {
        return element;
      }

            if (element != null) {
                String label = labelProvider.getText(element);
                if(label == null) {
          return null;
        }
                // remove the dirty prefix from the editor's label
                String prefix = DefaultTabItem.DIRTY_PREFIX;
View Full Code Here

TOP

Related Classes of org.eclipse.jface.viewers.ILabelProvider

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.