Package org.eclipse.swt.layout

Examples of org.eclipse.swt.layout.FormLayout


 
  protected void
  build(
    Composite    parent )
  {
    parent.setLayout(new FormLayout());
       
    Button cancel_button = new Button( parent, SWT.NULL );

    cancel_button.setText( "Cancel" );
   
View Full Code Here


      display = shell.getDisplay();
     
      window = org.gudy.azureus2.ui.swt.components.shell.ShellFactory.createShell(display,SWT.DIALOG_TRIM | SWT.RESIZE | SWT.APPLICATION_MODAL);
      Messages.setLanguageText(window,"updater.progress.window.title");
      Utils.setShellIcon(shell);
      FormLayout layout = new FormLayout();
      try {
        layout.spacing = 5;
      } catch (NoSuchFieldError e) {
        /* Ignore for Pre 3.0 SWT.. */
      }
View Full Code Here

    }

    final Shell window = org.gudy.azureus2.ui.swt.components.shell.ShellFactory.createShell(display,styles);
    Messages.setLanguageText(window,"ConfigView.section.ipfilter.list.title");
    Utils.setShellIcon(window);
    FormLayout layout = new FormLayout();
    try {
      layout.spacing = 5;
    } catch (NoSuchFieldError e) {
      /* Ignore for Pre 3.0 SWT.. */
    }
View Full Code Here

    Utils.centreWindow(shell);
   
    display = shell.getDisplay();
    shell.setText(MessageText.getString("externalLogin.title"));
   
    shell.setLayout(new FormLayout());
   
    shell.addDisposeListener(
      new DisposeListener()
      {
        public void
View Full Code Here

    Utils.centreWindow(shell);
   
    display = shell.getDisplay();
    shell.setText(MessageText.getString("subscriptions.listwindow.title"));
   
    shell.setLayout(new FormLayout());
   
    mainComposite = new Composite(shell,SWT.NONE);
    Label separator = new Label(shell,SWT.SEPARATOR | SWT.HORIZONTAL);
    Button cancel = new Button(shell,SWT.PUSH);
    action = new Button(shell,SWT.PUSH);
    cancel.setText(MessageText.getString("Button.cancel"));
   
    FormData data;
   
    data = new FormData();
    data.left = new FormAttachment(0,0);
    data.right = new FormAttachment(100,0);
    data.top = new FormAttachment(0,0);
    data.bottom = new FormAttachment(separator,0);
    mainComposite.setLayoutData(data);
   
    data = new FormData();
    data.left = new FormAttachment(0,0);
    data.right = new FormAttachment(100,0);
    data.bottom = new FormAttachment(cancel,-2);
    separator.setLayoutData(data);
   
    data = new FormData();
    data.right = new FormAttachment(action);
    data.width = 100;
    data.bottom = new FormAttachment(100,-5);
    cancel.setLayoutData(data);
   
    data = new FormData();
    data.right = new FormAttachment(100,-5);
    data.width = 100;
    data.bottom = new FormAttachment(100,-5);
    action.setLayoutData(data);
   
    cancel.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event arg0) {
        if(lookup != null) {
          lookup.cancel();
        }
        if(!shell.isDisposed()) {
          shell.dispose();
        }
      }
    });
   
    mainLayout = new StackLayout();
    mainComposite.setLayout(mainLayout);
   
    loadingPanel = new Composite(mainComposite,SWT.NONE);
    loadingPanel.setLayout(new FormLayout());
   
    listPanel = new Composite(mainComposite,SWT.NONE);
    listPanel.setLayout(new FillLayout());
   
    subscriptionsList = new Table(listPanel,SWT.V_SCROLL | SWT.SINGLE | SWT.FULL_SELECTION | SWT.VIRTUAL);
    subscriptionsList.setHeaderVisible(true);
   
    TableColumn name = new TableColumn(subscriptionsList,SWT.NONE);
    name.setText(MessageText.getString("subscriptions.listwindow.name"));
    name.setWidth(310);
    name.setResizable(false);
   
    TableColumn popularity = new TableColumn(subscriptionsList,SWT.NONE);
    popularity.setText(MessageText.getString("subscriptions.listwindow.popularity"));
    popularity.setWidth(70);
    popularity.setResizable(false);
   
    subscriptionsList.addListener(SWT.SetData, new Listener() {
      public void handleEvent(Event e) {
        TableItem item = (TableItem) e.item;
        int index = subscriptionsList.indexOf(item);
        if(index >= 0 && index < subscriptionItems.length) {
          SubscriptionItemModel subscriptionItem = subscriptionItems[index];
          item.setText(0,subscriptionItem.name);
          item.setText(1,subscriptionItem.popularityDisplay);
        }
      }
    });
   
    subscriptionsList.setSortColumn(popularity);
    subscriptionsList.setSortDirection(SWT.DOWN);
   
    subscriptionsList.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event arg0) {
        action.setEnabled(subscriptionsList.getSelectionIndex() != -1);
      }
    });
   
    Listener sortListener = new Listener() {
      public void handleEvent(Event e) {
        // determine new sort column and direction
        TableColumn sortColumn = subscriptionsList.getSortColumn();
        TableColumn currentColumn = (TableColumn) e.widget;
        int dir = subscriptionsList.getSortDirection();
        if (sortColumn == currentColumn) {
          dir = dir == SWT.UP ? SWT.DOWN : SWT.UP;
        } else {
          subscriptionsList.setSortColumn(currentColumn);
          dir = SWT.DOWN;
        }
        subscriptionsList.setSortDirection(dir);
        sortAndRefresh();
      }
    };
    name.addListener(SWT.Selection, sortListener);
    popularity.addListener(SWT.Selection, sortListener);
   
    animatedImage = new AnimatedImage(loadingPanel);
    loadingText = new Label(loadingPanel,SWT.WRAP | SWT.CENTER);
    loadingProgress = new ProgressBar(loadingPanel,SWT.HORIZONTAL);
   
    animatedImage.setImageFromName("spinner_big");
    String contentName = "Dummy";
    if(download != null) {
      contentName = download.getDisplayName();
    }
    loadingText.setText(MessageText.getString("subscriptions.listwindow.loadingtext", new String[] {contentName}));
   
    loadingProgress.setMinimum(0);
    loadingProgress.setMaximum(300);
    loadingProgress.setSelection(0);
   
    data = new FormData();
    data.left = new FormAttachment(1,2,-16);
    data.top = new FormAttachment(1,2,-32);
    data.width = 32;
    data.height = 32;
    animatedImage.setLayoutData(data);
   
    data = new FormData();
    data.left = new FormAttachment(0,5);
    data.right = new FormAttachment(100,-5);
    data.top = new FormAttachment(animatedImage.getControl(),10);
    data.height = 50;
    loadingText.setLayoutData(data);
   
    data = new FormData();
    data.left = new FormAttachment(0,5);
    data.right = new FormAttachment(100,-5);
    data.top = new FormAttachment(loadingText,5);
    loadingProgress.setLayoutData(data);
   
    boolean autoCheck = COConfigurationManager.getBooleanParameter("subscriptions.autocheck");
   
    if(autoCheck) {
      startChecking();
    } else {
      action.setText(MessageText.getString("Button.yes"));
      Composite acceptPanel = new Composite(mainComposite,SWT.NONE);
      acceptPanel.setLayout(new FormLayout());
     
      Label acceptLabel = new Label(acceptPanel,SWT.WRAP | SWT.CENTER);
     
      acceptLabel.setText(MessageText.getString("subscriptions.listwindow.autochecktext"));
     
View Full Code Here

  }
 
  public void initialize(Composite parent) {
   
    viewComposite = new Composite(parent,SWT.NONE);
    viewComposite.setLayout(new FormLayout());
   
    TableColumnCore[] columns = new TableColumnCore[] {
        new ColumnSubscriptionNew(TABLE_ID),
        new ColumnSubscriptionName(TABLE_ID),
        new ColumnSubscriptionNbNewResults(TABLE_ID),
        new ColumnSubscriptionNbResults(TABLE_ID),
        new ColumnSubscriptionLastChecked(TABLE_ID),
        new ColumnSubscriptionSubscribers(TABLE_ID),
        new ColumnSubscriptionAutoDownload(TABLE_ID),
        new ColumnSubscriptionCategory(TABLE_ID),
       
    };
   
    TableColumnManager tcm = TableColumnManager.getInstance();
    tcm.setDefaultColumnNames(TABLE_ID, new String[] {
      ColumnSubscriptionNew.COLUMN_ID,
      ColumnSubscriptionName.COLUMN_ID,
      ColumnSubscriptionNbNewResults.COLUMN_ID,
      ColumnSubscriptionNbResults.COLUMN_ID,
      ColumnSubscriptionAutoDownload.COLUMN_ID,
    });
   
    view = new TableViewSWTImpl(Subscription.class, TABLE_ID, TABLE_ID,
        columns, "name", SWT.SINGLE | SWT.FULL_SELECTION | SWT.VIRTUAL);
   
    view.addLifeCycleListener(new TableLifeCycleListener() {
      public void tableViewInitialized() {
        SubscriptionManagerFactory.getSingleton().addListener( SubscriptionsView.this );
       
        view.addDataSources(SubscriptionManagerFactory.getSingleton().getSubscriptions( true ));
      }
   
      public void tableViewDestroyed() {
        SubscriptionManagerFactory.getSingleton().removeListener( SubscriptionsView.this );

      }
    });
   
    view.addSelectionListener(new TableSelectionAdapter() {
      public void defaultSelected(TableRowCore[] rows, int stateMask) {
        if(rows.length == 1) {
          TableRowCore row = rows[0];
         
          Subscription sub = (Subscription) row.getDataSource();
          if(sub != null) {
            String key = "Subscription_" + ByteFormatter.encodeString(sub.getPublicKey());
            MultipleDocumentInterface mdi = UIFunctionsManager.getUIFunctions().getMDI();
            if (mdi != null) {
              mdi.showEntryByID(key);
            }
          }
        }
       
      }
     
      public void selected(TableRowCore[] rows) {
        ISelectedContent[] sels = new ISelectedContent[rows.length];
       
        for (int i=0;i<rows.length;i++){
         
          sels[i] = new SubscriptionSelectedContent((Subscription)rows[i].getDataSource());
        }
       
        SelectedContentManager.changeCurrentlySelectedContent(view.getTableID(),
            sels, view);
      }
     
    }, false) ;
   
    view.addKeyListener(new KeyListener() {
      public void keyPressed(KeyEvent event) {
       
      }
     
      public void keyReleased(KeyEvent event) {
        if(event.keyCode == SWT.DEL) {
          removeSelected();
        }
      }
    });
   
    view.setRowDefaultHeight(20);
   
    view.initialize(viewComposite);
   
    final Composite composite = new Composite(viewComposite,SWT.BORDER);
    composite.setBackgroundMode(SWT.INHERIT_DEFAULT);
    composite.setBackground(ColorCache.getColor(composite.getDisplay(), "#F1F9F8"));
   
    Font font = composite.getFont();
    FontData fDatas[] = font.getFontData();
    for(int i = 0 ; i < fDatas.length ; i++) {
      fDatas[i].setHeight(150 * fDatas[i].getHeight() / 100);
      if(Constants.isWindows) {
        fDatas[i].setStyle(SWT.BOLD);
      }
    }
   
    textFont1 = new Font(composite.getDisplay(),fDatas);
   
    fDatas = font.getFontData();
    for(int i = 0 ; i < fDatas.length ; i++) {
      fDatas[i].setHeight(120 * fDatas[i].getHeight() / 100);
    }
   
    textFont2 = new Font(composite.getDisplay(),fDatas);
   
    Label preText = new Label(composite,SWT.NONE);
    preText.setForeground(ColorCache.getColor(composite.getDisplay(), "#6D6F6E"));
    preText.setFont(textFont1);
    preText.setText(MessageText.getString("subscriptions.view.help.1"));
   
    Label image = new Label(composite,SWT.NONE);
    ImageLoader.getInstance().setLabelImage(image, "btn_rss_add");
   
    Link postText = new Link(composite,SWT.NONE);
    postText.setForeground(ColorCache.getColor(composite.getDisplay(), "#6D6F6E"));
    postText.setFont(textFont2);
    postText.setText(MessageText.getString("subscriptions.view.help.2"));
   
    postText.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event event) {
        if(event.text != null &&  ( event.text.startsWith("http://") || event.text.startsWith("https://") ) ) {
          Utils.launch(event.text);
        }
      }
    });
   
    Label close = new Label(composite,SWT.NONE);   
    ImageLoader.getInstance().setLabelImage(close, "image.dismissX");
    close.setCursor(composite.getDisplay().getSystemCursor(SWT.CURSOR_HAND));
    close.addListener(SWT.MouseUp, new Listener() {
      public void handleEvent(Event arg0) {
        COConfigurationManager.setParameter("subscriptions.view.showhelp", false);
        composite.setVisible(false);
        FormData data = (FormData) view.getComposite().getLayoutData();
        data.bottom = new FormAttachment(100,0);
        viewComposite.layout(true);
      }
    });
   
    FormLayout layout = new FormLayout();
    composite.setLayout(layout);
   
    FormData data;
   
    data = new FormData();
View Full Code Here

   
    Label bottomSeparator = new Label(shell,SWT.SEPARATOR |SWT.HORIZONTAL);
   
    Composite footer = new Composite(shell, SWT.NONE);
   
    FormLayout layout = new FormLayout();
    shell.setLayout(layout);
   
    FormData data;
   
    data = new FormData();
View Full Code Here

    url = ConstantsVuze.getDefaultContentNetwork().getExternalSiteRelativeURL(url, true);

    LinkLabel.makeLinkedLabel( link, url );
   
   
    FormLayout layout = new FormLayout();
    layout.marginHeight = 5;
    layout.marginWidth = 50;
    layout.spacing = 5;
   
    main.setLayout(layout);
View Full Code Here

     
    turnOnButton = new Button(footer,SWT.PUSH);
    turnOnButton.setText(MessageText.getString("Button.turnon"));
   
   
    FormLayout layout = new FormLayout();
    layout.marginHeight = 5;
    layout.marginWidth = 5;
    layout.spacing = 5;
   
    footer.setLayout(layout);
View Full Code Here

  public void initialize(final Shell shell, String startID,
      IUIIntializer uiInitializer) {

    this.shell = shell;
    this.startID = startID;
    FormLayout layout = new FormLayout();
    shell.setLayout(layout);
    shell.setBackgroundMode(SWT.INHERIT_DEFAULT);

    shell.addDisposeListener(new DisposeListener() {
      public void widgetDisposed(DisposeEvent e) {
View Full Code Here

TOP

Related Classes of org.eclipse.swt.layout.FormLayout

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.