Examples of FormData


Examples of org.eclipse.swt.layout.FormData

      SWTSkinObjectContainer soList = (SWTSkinObjectContainer) so;
     
      Composite parent = soList.getComposite();
     
      Canvas centerCanvas = new Canvas(parent, SWT.NONE);
      FormData fd = Utils.getFilledFormData();
      fd.bottom = null;
      fd.height = 0;
      centerCanvas.setLayoutData(fd);
     
     
View Full Code Here

Examples of org.eclipse.swt.layout.FormData

          button.setText(text);
          int width = properties.getIntValue(sConfigID + ".width", -1);
          if (width == -1) {
            int minWidth = properties.getIntValue(sConfigID + ".minwidth", -1);
            if (minWidth >= 0) {
              FormData fd = (FormData) button.getLayoutData();
              if (fd == null) {
                fd = new FormData();
              }
              Point size = button.computeSize(SWT.DEFAULT, SWT.DEFAULT);
              if (size.x < minWidth) {
                fd.width = minWidth;
              } else {
View Full Code Here

Examples of org.eclipse.swt.layout.FormData

  protected void createInfoBar() {
    Object ldForSO = forSO.getControl().getLayoutData();
    if (!(ldForSO instanceof FormData)) {
      return;
    }
    FormData fdForSO = (FormData) ldForSO;
    SWTSkinObject parent = forSO.getParent();
    soInfoBar = skin.createSkinObject("infobarutil", skintemplateid, parent);

    FormData fdInfoBar = (FormData) soInfoBar.getControl().getLayoutData();
    if (fdInfoBar == null) {
      fdInfoBar = Utils.getFilledFormData();
    }
    if (top) {
      fdInfoBar.top = new FormAttachment(fdForSO.top.control, fdForSO.top.offset,
View Full Code Here

Examples of org.eclipse.swt.layout.FormData

        fixupActionBarSize();
      }
    });

    final Text text = new Text(cArea, SWT.NONE);
    FormData filledFormData = Utils.getFilledFormData();
    text.setLayoutData(filledFormData);

    text.setData("ObfusticateImage", new ObfusticateImage() {
      public Image obfusticatedImage(Image image) {
        Point location = Utils.getLocationRelativeToShell(text);
        Point size = text.getSize();
        UIDebugGenerator.obfusticateArea(display, image, new Rectangle(
            location.x, location.y, size.x, size.y));
        return image;
      }
    });
   
    text.addListener(SWT.Resize, new Listener() {
      Font lastFont = null;

      public void handleEvent(Event event) {
        Text text = (Text) event.widget;

        int h = text.getClientArea().height - 2;
        Font font = FontUtils.getFontWithHeight(text.getFont(), null, h);
        if (font != null) {
          text.setFont(font);

          Utils.disposeSWTObjects(new Object[] {
            lastFont
          });

          text.addDisposeListener(new DisposeListener() {
            public void widgetDisposed(DisposeEvent e) {
              Text text = (Text) e.widget;
              text.setFont(null);
              Utils.disposeSWTObjects(new Object[] {
                lastFont
              });
            }
          });
        }
      }
    });
    text.setTextLimit(254);
   
    if (Constants.isWindows) {
      text.addListener(SWT.MouseDown, new Listener() {
        public void handleEvent(Event event) {
          if (event.count == 3) {
            text.selectAll();
          }
        }
      });
    }

    final String sDefault = MessageText.getString("v3.MainWindow.search.defaultText");

    SWTSkinProperties properties = skinObject.getProperties();
    colorSearchTextBG = properties.getColor("color.search.text.bg");
    colorSearchTextFG = properties.getColor("color.search.text.fg");
    colorSearchTextFGdef = properties.getColor("color.search.text.fg.default");

    if (colorSearchTextFGdef != null) {
      text.setForeground(colorSearchTextFGdef);
    }
    if (colorSearchTextBG != null) {
      text.setBackground(colorSearchTextBG);
    }
    text.addMouseListener(new MouseListener() {

      public void mouseUp(MouseEvent e) {
        Text text = (Text) e.widget;
        if (text.getText().equals(sDefault)) {
          if (colorSearchTextFG != null) {
            text.setForeground(colorSearchTextFG);
          }
          text.setText("");
        }
      }

      public void mouseDown(MouseEvent e) {
      }

      public void mouseDoubleClick(MouseEvent e) {
      }
    });

    text.addKeyListener(new KeyListener() {
      public void keyPressed(KeyEvent e) {
        if (e.stateMask == SWT.MOD1) {

          int key = e.character;
          if (key <= 26 && key > 0) {
            key += 'a' - 1;
          }

          if (key == 'a') {
            text.selectAll();
          }
        }

      }

      public void keyReleased(KeyEvent arg0) {
        // TODO Auto-generated method stub

      }
    });

    text.addListener(SWT.KeyDown, new Listener() {

      public void handleEvent(Event event) {
        if (text.getText().equals(sDefault)) {
          if (colorSearchTextFG != null) {
            text.setForeground(colorSearchTextFG);
          }
          if (event.character != '\0') {
            text.setText("");
          }
          return;
        }

        Text text = (Text) event.widget;
        if (event.keyCode == SWT.ESC) {
          text.setText("");
          return;
        }
        if (event.character == SWT.CR) {
          doSearch(text.getText());
        }
      }
    });

    // must be done after layout
    text.setText(sDefault);
    //text.selectAll();

    SWTSkinObject searchGo = skin.getSkinObject("search-go");
    if (searchGo != null) {
      SWTSkinButtonUtility btnGo = new SWTSkinButtonUtility(searchGo);
      btnGo.addSelectionListener(new ButtonListenerAdapter() {
        public void pressed(SWTSkinButtonUtility buttonUtility,
            SWTSkinObject skinObject, int stateMask) {
          String sSearchText = text.getText().trim();
          doSearch(sSearchText);
        }
      });
    }

    SWTSkinObject so = skin.getSkinObject("sidebar-list");
    if (so != null
        && so.getProperties().getBooleanValue(
            so.getConfigID() + ".resizeSearch", false)) {
      Listener l = new Listener() {
        public void handleEvent(Event event) {
          SWTSkinObject soSearchArea = skin.getSkinObject("topbar-area-search");
          if (soSearchArea != null) {
            Control c = soSearchArea.getControl();
            Rectangle bounds = ((Control) event.widget).getBounds();
            FormData fd = (FormData) c.getLayoutData();
            int newWidth = bounds.width - 1 - c.getBounds().x;
            if (bounds.width < 125) {
              return;
            }
            fd.width = newWidth;
View Full Code Here

Examples of org.eclipse.swt.layout.FormData

    Rectangle clientArea = shell.getClientArea();
    SWTSkinObject soSearch = skin.getSkinObject("topbar-area-search");
    if (soSearch == null) {
      return;
    }
    FormData fd = (FormData) soSearch.getControl().getLayoutData();
    if (fd == null || fd.width <= 0) {
      return;
    }
    if (clientArea.width > 1124 && fd.width == MAXWIDTH) {
      return;
View Full Code Here

Examples of org.eclipse.swt.layout.FormData

      layout.marginRight  = 4;
      layout.marginBottom  = 4;
     
      composite.setLayout( layout );

      FormData data = new FormData();
      data.left = new FormAttachment(0,0);
      data.right = new FormAttachment(100,0);
      data.top = new FormAttachment(composite,0);
      data.bottom = new FormAttachment(100,0);
View Full Code Here

Examples of org.eclipse.swt.layout.FormData

      layout.marginRight  = 4;
      layout.marginBottom  = 4;
     
      composite.setLayout( layout );
     
      FormData data = new FormData();
     
      data.left   = new FormAttachment(0,0);
      data.right   = new FormAttachment(100,0);
      data.top   = new FormAttachment(composite,0);
      data.bottom = new FormAttachment(100,0);
View Full Code Here

Examples of org.eclipse.swt.layout.FormData

    } else {
      createOn = (Composite) parent.getControl();
    }

    canvas = new Canvas(createOn, style);
    canvas.setLayoutData(new FormData(maxSize.x == 0 ? SWT.DEFAULT
        : maxSize.x, maxSize.y));
    canvas.setSize(SWT.DEFAULT, maxSize.y);
    setControl(canvas);
   
    canvas.addDisposeListener(new DisposeListener() {
View Full Code Here

Examples of org.eclipse.swt.layout.FormData

 
  protected void layout() {
    Label label = new Label(shell,SWT.NULL);
    ImageLoader.getInstance().setLabelImage(label, "popup");
   
    FormData formData = new FormData();
    formData.left = new FormAttachment(0,0);
    formData.top = new FormAttachment(0,0);
   
    label.setLayoutData(formData);
   
View Full Code Here

Examples of org.eclipse.swt.layout.FormData

 
  if ( shellImg != null ){
    lblImage.setImage(shellImg);
  }
   
    FormData formData;
   
    formData = new FormData();   
    formData.right = new FormAttachment(btnHide,-5);
    formData.bottom = new FormAttachment(100,-5);
    btnDetails.setLayoutData(formData);
   
    formData = new FormData();
    formData.right = new FormAttachment(100,-5);
    formData.bottom = new FormAttachment(100,-5);
    btnHide.setLayoutData(formData);
   
    formData = new FormData();
    formData.left = new FormAttachment(0,0);
    formData.top = new FormAttachment(0,0);
    lblImage.setLayoutData(formData);
   
    Button btnHideAll = null;
    if (viewStack.size() > 0) {
      btnHideAll = new Button(shell, SWT.PUSH);
      btnHideAll.moveAbove(btnDetails);
      Messages.setLanguageText(btnHideAll, "popup.error.hideall");
     
      formData = new FormData();
      formData.right = new FormAttachment(btnDetails, -5);
      formData.bottom  = new FormAttachment(100,-5);
      btnHideAll.setLayoutData(formData);
     
      btnHideAll.addListener(SWT.MouseUp, new Listener() {
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.