Examples of PixelConverter


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

    GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_CENTER
        | GridData.VERTICAL_ALIGN_FILL);
    composite.setLayoutData(gd);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    PixelConverter pc = new PixelConverter(composite);
    layout.verticalSpacing = pc.convertHeightInCharsToPixels(1) / 2;
    composite.setLayout(layout);

    /* check box for new editors */
    fFoldingCheckbox = new Button(composite, SWT.CHECK);
    fFoldingCheckbox
View Full Code Here

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

  /*
   * @see DialogField#doFillIntoGrid
   */
  public Control[] doFillIntoGrid(Composite parent, int nColumns) {
    PixelConverter converter = new PixelConverter(parent);

    assertEnoughColumns(nColumns);

    Label label = getLabelControl(parent);
    GridData gd = gridDataForLabel(1);
    gd.verticalAlignment = GridData.BEGINNING;
    label.setLayoutData(gd);

    Control list = getListControl(parent);
    gd = new GridData();
    gd.horizontalAlignment = GridData.FILL;
    gd.grabExcessHorizontalSpace = false;
    gd.verticalAlignment = GridData.FILL;
    gd.grabExcessVerticalSpace = true;
    gd.horizontalSpan = nColumns - 2;
    gd.widthHint = converter.convertWidthInCharsToPixels(50);
    gd.heightHint = converter.convertHeightInCharsToPixels(6);

    list.setLayoutData(gd);

    Composite buttons = getButtonBox(parent);
    gd = new GridData();
View Full Code Here

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

    parent.setLayout(layout);
  }

  public static int getButtonWidthHint(final Button button) {
    button.setFont(JFaceResources.getDialogFont());
    final PixelConverter converter = new PixelConverter(button);
    final int widthHint = converter
        .convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
    return Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT,
        true).x);
  }
View Full Code Here

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

  public void postSetSelection(Object element) {
    fCodeTemplateTree.postSetSelection(new StructuredSelection(element));
  }

  protected Control createContents(Composite parent) {
    fPixelConverter = new PixelConverter(parent);

    setShell(parent.getShell());

    Composite composite = new Composite(parent, SWT.NONE);
    composite.setFont(parent.getFont());
View Full Code Here

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

  /*
   * @see DialogField#doFillIntoGrid
   */
  public Control[] doFillIntoGrid(Composite parent, int nColumns) {
    PixelConverter converter = new PixelConverter(parent);

    assertEnoughColumns(nColumns);

    Label label = getLabelControl(parent);
    GridData gd = gridDataForLabel(1);
    gd.verticalAlignment = GridData.BEGINNING;
    label.setLayoutData(gd);

    Control list = getTreeControl(parent);
    gd = new GridData();
    gd.horizontalAlignment = GridData.FILL;
    gd.grabExcessHorizontalSpace = false;
    gd.verticalAlignment = GridData.FILL;
    gd.grabExcessVerticalSpace = true;
    gd.horizontalSpan = nColumns - 2;
    gd.widthHint = converter.convertWidthInCharsToPixels(50);
    gd.heightHint = converter.convertHeightInCharsToPixels(6);

    list.setLayoutData(gd);

    Composite buttons = getButtonBox(parent);
    gd = new GridData();
View Full Code Here

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

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

    PixelConverter conv = new PixelConverter(parent);

    ScrolledCompositeImpl scrolledCompositeImpl = new ScrolledCompositeImpl(
        parent, SWT.V_SCROLL | SWT.H_SCROLL);
    Composite composite = new Composite(scrolledCompositeImpl, SWT.NONE);
    composite.setLayout(layout);
    scrolledCompositeImpl.setContent(composite);

    scrolledCompositeImpl.setLayout(layout);
    scrolledCompositeImpl.setFont(parent.getFont());

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

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

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

    return checkBox;
  }

  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

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

    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 = fTodoTasksList.getListControl(markersComposite);
    listControl.setLayoutData(data);

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

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

  protected File getIniLocation() {
    return new File(fPHPIni.getText());
  }

  protected void createControl() {
    PixelConverter pixelConverter = new PixelConverter(this);

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

    Composite parent = new Composite(this, SWT.NONE);
    layout = new GridLayout();
    layout.numColumns = 3;
    parent.setLayout(layout);
    parent.setLayoutData(new GridData(GridData.FILL_BOTH));

    fPHPexeName = new StringDialogField();
    fPHPexeName.setLabelText(PHPDebugUIMessages.addPHPexeDialog_phpName);

    fPHPExePath = new StringButtonDialogField(new IStringButtonAdapter() {
      public void changeControlPressed(DialogField field) {
        FileDialog dialog = new FileDialog(getShell());
        dialog.setFilterPath(fPHPExePath.getText());
        dialog.setText(PHPDebugUIMessages.addPHPexeDialog_pickPHPRootDialog_message);
        String newPath = dialog.open();
        if (newPath != null) {
          fPHPExePath.setText(newPath);
          File executable = new File(newPath);
          PHPExeInfo phpExecInfo = getPHPInfo(executable);
          if (phpExecInfo != null) {
            if (fPHPexeName.getText().isEmpty()
                && phpExecInfo.getName() != null)
              fPHPexeName.setTextWithoutUpdate(phpExecInfo
                  .getName());
            if (phpExecInfo.getSapiType() != null)
              fSapiTypes.setText(phpExecInfo.getSapiType());
          }
        }
        updateItem();
      }
    });
    fPHPExePath.setLabelText(PHPDebugUIMessages.addPHPexeDialog_phpHome);
    fPHPExePath.setButtonLabel(PHPDebugUIMessages.addPHPexeDialog_browse1);

    fPHPIni = new StringButtonDialogField(new IStringButtonAdapter() {
      public void changeControlPressed(DialogField field) {
        FileDialog dialog = new FileDialog(getShell());
        dialog.setFilterPath(fPHPIni.getText());
        dialog.setFilterExtensions(new String[] { "*.ini", "*.*" }); //$NON-NLS-1$ //$NON-NLS-2$
        dialog.setText(PHPDebugUIMessages.addPHPexeDialog_pickPHPIniDialog_message);
        String newPath = dialog.open();
        if (newPath != null) {
          fPHPIni.setText(newPath);
          isIniFileSet = true;
        }
      }
    });
    fPHPIni.setLabelText(PHPDebugUIMessages.addPHPexeDialog_phpIni);
    fPHPIni.setButtonLabel(PHPDebugUIMessages.addPHPexeDialog_browse1);

    fPHPexeName.doFillIntoGrid(parent, 3);
    fPHPExePath.doFillIntoGrid(parent, 3);
    ((GridData) fPHPExePath.getTextControl(parent).getLayoutData()).widthHint = pixelConverter
        .convertWidthInCharsToPixels(50);

    fPHPIni.doFillIntoGrid(parent, 3);
    ((GridData) fPHPIni.getTextControl(parent).getLayoutData()).widthHint = pixelConverter
        .convertWidthInCharsToPixels(50);

    fLoadDefaultPHPIni = new Button(parent, SWT.CHECK);
    fLoadDefaultPHPIni
        .setText(PHPDebugUIMessages.addPHPexeDialog_loadDefaultPHPIni);
View Full Code Here

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
TOP
Copyright © 2018 www.massapi.com. 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.