Package org.eclipse.php.internal.ui.util

Examples of org.eclipse.php.internal.ui.util.PixelConverter


    Composite mainComp = new Composite(parent, SWT.None);
    mainComp.setLayout(new GridLayout());
    mainComp.setLayoutData(new GridData(GridData.FILL_BOTH));

    PixelConverter pixelConverter = new PixelConverter(mainComp);

    // Remote path text field:
    Label label = new Label(mainComp, SWT.NONE);
    label.setText(Messages.PathMapperEntryDialog_2);

    fRemotePathText = new Text(mainComp, SWT.BORDER);
    fRemotePathText.addModifyListener(new ModifyListener() {
      public void modifyText(ModifyEvent e) {
        // System.out.println(fRemotePathText.getText());
        ignorePathText.setText(fRemotePathText.getText());
        validate();
      }
    });
    GridData layoutData = new GridData(GridData.FILL_HORIZONTAL);
    // layoutData.widthHint =
    // pixelConverter.convertWidthInCharsToPixels(90);
    fRemotePathText.setLayoutData(layoutData);

    // Radio buttons group:
    Composite typeSelectionGroup = new Composite(mainComp, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    typeSelectionGroup.setLayout(layout);
    typeSelectionGroup.setLayoutData(new GridData(GridData.FILL_BOTH));

    // Workspace file:
    fWorkspacePathBtn = new Button(typeSelectionGroup, SWT.RADIO);
    layoutData = new GridData(GridData.FILL_HORIZONTAL);
    layoutData.horizontalSpan = 2;
    fWorkspacePathBtn.setLayoutData(layoutData);
    fWorkspacePathBtn.setText(Messages.PathMapperEntryDialog_3);
    fWorkspacePathBtn.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        boolean enabled = fWorkspacePathBtn.getSelection();
        fWorkspacePathText.setEnabled(enabled);
        fWorkspacePathBrowseBtn.setEnabled(enabled);
        fExternalPathText.setEnabled(!enabled);
        fExternalPathBrowseBtn.setEnabled(!enabled);
        ignorePathText.setEnabled(!enabled);
        validate();
      }
    });

    fWorkspacePathText = new Text(typeSelectionGroup, SWT.BORDER);
    layoutData = new GridData(GridData.FILL_HORIZONTAL);
    layoutData.horizontalIndent = pixelConverter
        .convertWidthInCharsToPixels(1);
    fWorkspacePathText.setLayoutData(layoutData);
    fWorkspacePathText.addModifyListener(new ModifyListener() {
      public void modifyText(ModifyEvent e) {
        validate();
      }
    });

    fWorkspacePathBrowseBtn = new Button(typeSelectionGroup, SWT.NONE);
    fWorkspacePathBrowseBtn.setText(Messages.PathMapperEntryDialog_4);
    fWorkspacePathBrowseBtn.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        WorkspaceBrowseDialog dialog = new WorkspaceBrowseDialog(
            getShell());
        if (dialog.open() == Window.OK) {
          Object selectedElement = dialog.getSelectedElement();
          fWorkspacePathText.setData(null);
          if (selectedElement instanceof IResource) {
            IResource resource = (IResource) selectedElement;
            fWorkspacePathText.setData(Type.WORKSPACE);
            fWorkspacePathText.setText(resource.getFullPath()
                .toString());
          } else if (selectedElement instanceof IBuildpathEntry) {
            IBuildpathEntry includePathEntry = (IBuildpathEntry) selectedElement;
            fWorkspacePathText.setData(includePathEntry
                .getEntryKind() == IBuildpathEntry.BPE_VARIABLE ? Type.INCLUDE_VAR
                : Type.INCLUDE_FOLDER);
            if (includePathEntry.getEntryKind() == IBuildpathEntry.BPE_VARIABLE) {
              IPath incPath = DLTKCore
                  .getResolvedVariablePath(includePathEntry
                      .getPath());
              if (incPath != null) {
                fWorkspacePathText.setText(incPath.toOSString());
              }
            } else {
              fWorkspacePathText.setText(EnvironmentPathUtils
                  .getLocalPath(includePathEntry.getPath())
                  .toOSString());
            }
          } else if (selectedElement instanceof IPFile) {
            IPFile ipFile = (IPFile) selectedElement;
            IBuildpathEntry includePathEntry = ipFile.includePathEntry;
            fWorkspacePathText.setData(includePathEntry
                .getEntryKind() == IBuildpathEntry.BPE_VARIABLE ? Type.INCLUDE_VAR
                : Type.INCLUDE_FOLDER);
            fWorkspacePathText.setText(ipFile.file
                .getAbsolutePath());
          }
        }
      }
    });

    // External file:
    fExternalPathBtn = new Button(typeSelectionGroup, SWT.RADIO);
    layoutData = new GridData(GridData.FILL_HORIZONTAL);
    layoutData.horizontalSpan = 2;
    fExternalPathBtn.setLayoutData(layoutData);
    fExternalPathBtn.setText(Messages.PathMapperEntryDialog_5);
    fExternalPathBtn.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        boolean enabled = fExternalPathBtn.getSelection();
        fExternalPathText.setEnabled(enabled);
        fExternalPathBrowseBtn.setEnabled(enabled);
        fWorkspacePathText.setEnabled(!enabled);
        fWorkspacePathBrowseBtn.setEnabled(!enabled);
        ignorePathText.setEnabled(!enabled);
        validate();
      }
    });

    fExternalPathText = new Text(typeSelectionGroup, SWT.BORDER);
    layoutData = new GridData(GridData.FILL_HORIZONTAL);
    layoutData.horizontalIndent = pixelConverter
        .convertWidthInCharsToPixels(1);
    fExternalPathText.setLayoutData(layoutData);
    fExternalPathText.addModifyListener(new ModifyListener() {
      public void modifyText(ModifyEvent e) {
        validate();
      }
    });

    fExternalPathBrowseBtn = new Button(typeSelectionGroup, SWT.NONE);
    fExternalPathBrowseBtn.setText(Messages.PathMapperEntryDialog_6);
    fExternalPathBrowseBtn.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        DirectoryDialog dialog = new DirectoryDialog(getShell());
        String path = dialog.open();
        if (path != null) {
          fExternalPathText.setText(path);
        }
      }
    });

    ignoreMappingBtn = new Button(typeSelectionGroup, SWT.RADIO);
    ignoreMappingBtn
        .setText(Messages.PathMapperEntryDialog_18);
    layoutData = new GridData(GridData.FILL_HORIZONTAL);
    layoutData.horizontalSpan = 2;
    ignoreMappingBtn.setLayoutData(layoutData);
    ignoreMappingBtn.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        boolean enabled = ignoreMappingBtn.getSelection();
        fWorkspacePathText.setEnabled(!enabled);
        fWorkspacePathBrowseBtn.setEnabled(!enabled);
        fExternalPathText.setEnabled(!enabled);
        fExternalPathBrowseBtn.setEnabled(!enabled);
        ignorePathText.setEnabled(enabled);
        // configurePathBtn.setEnabled(enabled);
        validate();
      }
    });

    ignorePathText = new Text(typeSelectionGroup, SWT.BORDER
        | SWT.READ_ONLY);
    ignorePathText.setEnabled(false);
    layoutData = new GridData(GridData.FILL_HORIZONTAL);
    // layoutData.horizontalIndent = convertWidthInCharsToPixels(2);
    layoutData.horizontalIndent = pixelConverter
        .convertWidthInCharsToPixels(1);
    layoutData.widthHint = convertWidthInCharsToPixels(70);
    ignorePathText.setLayoutData(layoutData);
    ignorePathText.setText(""); //$NON-NLS-1$
View Full Code Here


    protected Control createDialogArea(Composite parent) {
      parent = (Composite) super.createDialogArea(parent);
      parent.setLayoutData(new GridData(GridData.FILL_BOTH));

      PixelConverter pixelConverter = new PixelConverter(parent);

      fViewer = new TreeViewer(parent, SWT.SINGLE | SWT.H_SCROLL
          | SWT.V_SCROLL | SWT.BORDER);
      GridData layoutData = new GridData(GridData.FILL_BOTH);
      layoutData.widthHint = pixelConverter
          .convertWidthInCharsToPixels(70);
      layoutData.heightHint = pixelConverter
          .convertHeightInCharsToPixels(20);
      fViewer.getControl().setLayoutData(layoutData);

      fViewer.setContentProvider(new ContentProvider());
      fViewer.setLabelProvider(new LabelProvider());
View Full Code Here

    GridLayout layout = new GridLayout();
    setLayout(layout);
    setLayoutData(new GridData(GridData.FILL_BOTH));

    PixelConverter conv = new PixelConverter(this);

    ScrolledCompositeImpl scrolledCompositeImpl = new ScrolledCompositeImpl(
        this, SWT.V_SCROLL | SWT.H_SCROLL);
    scrolledCompositeImpl.setLayout(layout);
    scrolledCompositeImpl.setLayoutData(new GridData(GridData.FILL_BOTH));

    Composite composite = new Composite(scrolledCompositeImpl, SWT.NONE);
    layout = new GridLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.numColumns = 2;
    composite.setLayout(layout);
    scrolledCompositeImpl.setContent(composite);
    scrolledCompositeImpl.setFont(getFont());

    GridData data = new GridData(GridData.FILL_BOTH);
    data.widthHint = conv.convertWidthInCharsToPixels(50);
    Control listControl = fMapList.getListControl(composite);
    listControl.setLayoutData(data);

    Control buttonsControl = fMapList.getButtonBox(composite);
    buttonsControl.setLayoutData(new GridData(
View Full Code Here

   */
  public Composite createContents(Composite parent) {
    final int numColumns = 4;

    if (fPixelConverter == null) {
      fPixelConverter = new PixelConverter(parent);
    }

    final SashForm sashForm = new SashForm(parent, SWT.HORIZONTAL);
    sashForm.setFont(parent.getFont());

View Full Code Here

    return composite;
  }

  private void addFiller(Composite composite) {
    PixelConverter pixelConverter = new PixelConverter(composite);

    Label filler = new Label(composite, SWT.LEFT);
    GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    gd.horizontalSpan = 2;
    gd.heightHint = pixelConverter.convertHeightInCharsToPixels(1) / 2;
    filler.setLayoutData(gd);
  }
View Full Code Here

    isInitialized = true;
  }

  public final Composite createContents(Composite parent) {
    if (fPixelConverter == null)
      fPixelConverter = new PixelConverter(parent);

    Composite composite = new Composite(parent, SWT.NONE);
    composite.setLayoutData(new GridData());

    final int numColumns = 2;
View Full Code Here

  }

  protected Control createContents(Composite parent) {
    final int numColumns = 5;

    fPixConv = new PixelConverter(parent);
    fComposite = createComposite(parent, numColumns);

    fProfileCombo = createProfileCombo(fComposite, numColumns - 3,
        fPixConv.convertWidthInCharsToPixels(20));
    fEditButton = createButton(
View Full Code Here

        GridLayout layout = new GridLayout();
        layout.marginHeight = 0;
        layout.marginWidth = 0;
        layout.numColumns = 2;

        PixelConverter conv = new PixelConverter(folder);

        Composite markersComposite = new Composite(folder, SWT.NULL);
        markersComposite.setLayout(layout);
        markersComposite.setFont(folder.getFont());

        GridData data = new GridData(GridData.FILL_BOTH);
        data.widthHint = conv.convertWidthInCharsToPixels(50);
        Control listControl = serviceList.getListControl(markersComposite);
        listControl.setLayoutData(data);

        Control buttonsControl = serviceList.getButtonBox(markersComposite);
        buttonsControl.setLayoutData(new GridData(
View Full Code Here

TOP

Related Classes of org.eclipse.php.internal.ui.util.PixelConverter

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.