Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.List


    editorComposite.setLayout(layout);
    gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.FILL_VERTICAL);
    gd.horizontalSpan= 2;
    editorComposite.setLayoutData(gd);

    fAppearanceColorList= new List(editorComposite, SWT.SINGLE | SWT.V_SCROLL | SWT.BORDER);
    gd= new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_BOTH);
    gd.heightHint= fAppearanceColorList.getItemHeight() * 8;
    fAppearanceColorList.setLayoutData(gd);

    Composite stylesComposite= new Composite(editorComposite, SWT.NONE);
View Full Code Here


    GridData alignTop = new GridData();
    alignTop.verticalAlignment = SWT.TOP;
   
    Composite outGroup = new Composite(gui,SWT.NULL);
    outGroup.setLayout(new GridLayout(2,false));
    outbound = new List(outGroup,SWT.SINGLE | SWT.V_SCROLL);
    outbound.setLayoutData(listSize);
    Composite outGroupButtons = new Composite(outGroup,SWT.NULL);
    outGroupButtons.setLayoutData(alignTop);
    outGroupButtons.setLayout(new GridLayout(1,true));
    Button addOutbound = new Button(outGroupButtons,SWT.PUSH);
    addOutbound.setText("Add target...");
    addOutbound.setImage(AbstractUIPlugin.imageDescriptorFromPlugin("XCDEVoice","icons/newaudio.png").createImage());
    addOutbound.addListener(SWT.Selection, new Listener()
        {
        public void handleEvent(Event event)
          {
          XCDEAudioRemoteHostDialog d = new XCDEAudioRemoteHostDialog(new Shell());
          ServerInfo info = d.open(new ServerInfo("",64656));
          if (info == null || info.server.equals("") || info.port < 1 || info.port > 65536)
            {
            MessageDialog.openError(new Shell(),"Invalid Connection Configuration", "The connction configuaration you specified is invalid, please try again.");
            return;
            }
          InetAddress addr = null;
          try
            {
            addr = InetAddress.getByName(info.server);
            }
          catch (UnknownHostException e)
            {
            MessageDialog.openError(new Shell(),"Unknown Host", "The host " + info.server + " could not be found, please try again.");
            return;
            }
         
          try
            {
            rtpManager.addTarget(new SessionAddress(addr,info.port));
            }
          catch (IOException e)
            {
            MessageDialog.openError(new Shell(),"I/O Exception", "An I/O Exception occured while trying to connect the audio");
            e.printStackTrace(System.err);
            return;
            }
          catch (InvalidSessionAddressException e)
            {
            MessageDialog.openError(new Shell(),"Invalid Session ADdress", "The session address specified is invalid");
            e.printStackTrace(System.err);
            return;
            }
          AudioTransmit at = new AudioTransmit(cdi.getLocator(),addr.getHostAddress(),Integer.toString(info.port));
         
          // Start the transmission
          String result = at.start();

          // result will be non-null if there was an error. The return
          // value is a String describing the possible error. Print it.
          if (result != null)
            {
            MessageDialog.openError(new Shell(),"Error Starting Audio Stream","Error: " + result);
            return;
            }
         
          out.put(info,at);
          updateOutList();
          }
        });
   
    Button removeOutbound = new Button(outGroupButtons,SWT.PUSH);
    removeOutbound.setText("Remove target...");
    removeOutbound.setImage(AbstractUIPlugin.imageDescriptorFromPlugin("XCDEVoice","icons/removeaudio.png").createImage());
    removeOutbound.addListener(SWT.Selection, new Listener()
        {
        public void handleEvent(Event event)
          {
          int selIndex = outbound.getSelectionIndex();
          if (selIndex == -1)
            return;
          String item = outbound.getItem(selIndex);
          String[] parts = item.split(":");
          ServerInfo toRemove = new ServerInfo(parts[0],Integer.parseInt(parts[1]));
          AudioTransmit at = (AudioTransmit)out.get(toRemove);
          if (at == null)
            return;
          at.stop();
          try
            {
            rtpManager.removeTarget(new SessionAddress(InetAddress.getByName(parts[0]),Integer.parseInt(parts[1])), "disconnecting");
            }
          catch (Exception e)
            {
            throw new RuntimeException(e);
            }
          out.remove(toRemove);
          updateOutList();
//          if (outbound.getItemCount() < 1)
//            {
//            for (Iterator i = in.values().iterator(); i.hasNext(); )
//              {
//              ((Player)i.next()).stop();
//              }
//            inbound.removeAll();
//            in.clear();
//            }
          }
        });
   
    Composite inGroup = new Composite(gui,SWT.NULL);
    inGroup.setLayout(new GridLayout(2,false));
    inbound = new List(inGroup,SWT.SINGLE | SWT.V_SCROLL);
    inbound.setLayoutData(listSize);
    Composite inGroupButtons = new Composite(inGroup,SWT.NULL);
    inGroupButtons.setLayoutData(alignTop);
    inGroupButtons.setLayout(new GridLayout(1,true));
    Button stopListening = new Button(inGroupButtons,SWT.PUSH);
View Full Code Here

            titleLabel.setText(title);
            titleLabel.setLayoutData(titleData);
            //Adds a dummy label to "pad out" title row to two cols.
            new Label(container, SWT.NONE);
        }
        list = new List(container, style);
        GridData listGridData = new GridData(GridData.FILL_BOTH);
        list.setLayoutData(listGridData);
        list.addSelectionListener(new SelectionAdapter() {
            public void widgetSelected(SelectionEvent e) {
                updateButtons();
View Full Code Here

     * made.
     * @param parent the parent Composte for the list
     * @return the List widget
     */
    private List addList(Composite parent) {
        List list = new List(parent, SWT.MULTI |
                SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
        GridData listGridData = new GridData(GridData.FILL_BOTH);
        listGridData.heightHint = HEIGHT_HINT;
        listGridData.widthHint = WIDTH_HINT;
        list.setLayoutData(listGridData);
        list.addSelectionListener(new SelectionAdapter() {
            public void widgetSelected(SelectionEvent selectionEvent) {
                updateButtons();
            }
        });
        return list;
View Full Code Here

    /**
     * Creates and adds the list widget.
     */
    private void addList() {
        fontList = new List(this, SWT.SINGLE |
                SWT.BORDER | SWT.V_SCROLL);
        GridData fontListWidgetData = new GridData(GridData.FILL_BOTH);
        fontListWidgetData.heightHint = MIN_LIST_HEIGHT;
        fontList.setLayoutData(fontListWidgetData);
        populateList();
View Full Code Here

        String[] filter = {"deviceName"};
        PolicyAttributesDetails attrDetails =
                new PolicyAttributesDetails("imageComponent",
                        new Filter(filter, Filter.EXCLUDE), true);
        final List list = new List(container, SWT.MULTI);
        final String[] attrs = attrDetails.getAttributes();
        for (int i = 0; i < attrs.length; i++) {
            list.add(attrs[i]);
        }

        final Composite fillerComposite = new Composite(container, SWT.NONE);
        fillerComposite.setBackground(getShell().getDisplay().getSystemColor(SWT.COLOR_CYAN));

        fillerComposite.setLayout(new GridLayout(1, false));
        fillerComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL |
                GridData.VERTICAL_ALIGN_BEGINNING));


        AttributesCompositeBuilder acb = AttributesCompositeBuilder.
                getSingleton();
        final AttributesComposite ac = acb.buildAttributesComposite(fillerComposite,
                attrDetails, project, null);

        Button select = new Button(container, SWT.PUSH);
        select.setText("Select");

        Button showHide = new Button(container, SWT.PUSH);
        showHide.setText("Show/Hide");


        Button focus = new Button(container, SWT.PUSH);
        focus.setText("Set XPath Focus");

        Composite valueSetter = new Composite(container, SWT.PUSH);
        GridData valueSetterData = new GridData(GridData.FILL_HORIZONTAL);
        valueSetter.setLayoutData(valueSetterData);

        valueSetter.setLayout(new GridLayout(2, false));


        GridData textData = new GridData(GridData.FILL_HORIZONTAL);
        final Text text = new Text(valueSetter, SWT.BORDER | SWT.SINGLE);
        text.setLayoutData(textData);

        Button setValue = new Button(valueSetter, SWT.PUSH);
        setValue.setText("Set Value");
        setValue.addSelectionListener(new SelectionListener() {
            public void widgetSelected(SelectionEvent event) {
                String[] selection = list.getSelection();
                if (selection != null && selection.length > 0) {
                    ac.setAttributeValue(selection[0], text.getText());
                }
            }

            public void widgetDefaultSelected(SelectionEvent event) {
                widgetSelected(event);
            }
        });

        focus.addSelectionListener(new SelectionListener() {
            public void widgetSelected(SelectionEvent event) {
                String[] selection = list.getSelection();
                if (selection != null && selection.length > 0) {
                    XPath path = new XPath("/@" + selection[0]);
                    System.out.println("XPath focus success = " +
                            ac.setFocus(path));
                }
            }

            public void widgetDefaultSelected(SelectionEvent event) {
                widgetSelected(event);
            }
        });

        showHide.addSelectionListener(new SelectionListener() {
            boolean acVisible = true;

            public void widgetSelected(SelectionEvent event) {
                acVisible = !acVisible;
                ac.setVisible(acVisible);
            }

            public void widgetDefaultSelected(SelectionEvent event) {
                widgetSelected(event);
            }
        });

        select.addSelectionListener(new SelectionListener() {
            public void widgetSelected(SelectionEvent event) {
                ac.setVisible(list.getSelection());
                fillerComposite.layout(true);
                fillerComposite.pack();
            }

            public void widgetDefaultSelected(SelectionEvent event) {
View Full Code Here

        GridLayout layout = new GridLayout();
        container.setLayout(layout);
        layout.numColumns = 2;
        layout.verticalSpacing = 9;

        _list = new List(container, SWT.BORDER | SWT.SINGLE);
        String[] st = new String[_templates.size()];
        for (int i = 0; i < _templates.size(); i++) {
            st[i] = (String)_templates.get(i).get("title");
        }
        _list.setItems(st);
View Full Code Here

    okButton.setBounds(350, 433, 72, 23);

    final Group resourcesGroup = new Group(this, SWT.NONE);
    resourcesGroup.setBounds(10, 34, 476, 80);

    list = new List(resourcesGroup, SWT.BORDER);
    list.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        System.out.println(list.getItem(list.getSelectionIndex()));
      }
    });
View Full Code Here

    relationsWeighLabel_1.setText(ApplicationResources.getString("LoadConfiguration.20")); //$NON-NLS-1$

    final Group resourcesGroup = new Group(shell, SWT.NONE);
    resourcesGroup.setBounds(10, 30, 523, 80);

    resources = new List(resourcesGroup, SWT.BORDER);
    resources.setBounds(10, 15, 406, 54);

    final Button deleteButton = new Button(resourcesGroup, SWT.NONE);
    deleteButton.setImage(SWTResourceManager.getImage(LoadConfiguration.class, ApplicationResources.getString("LoadConfiguration.21"))); //$NON-NLS-1$
    deleteButton.addSelectionListener(new SelectionAdapter() {
View Full Code Here

        
        Label headerLabel = new Label(container, SWT.NULL);
        headerLabel.setText("The following rules are available:");       
        headerLabel.setLayoutData(new GridData());
       
        ruleList = new List(container, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL );
        ruleList.setLayoutData(new GridData(TreeHelperUtil.treeControlWidth, TreeHelperUtil.treeControlHeight));
        ruleList.deselectAll();
       
        final java.util.List<EObject> rules = Activator.getAccessLayer().getElements(project, "Rule");
                       
View Full Code Here

TOP

Related Classes of org.eclipse.swt.widgets.List

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.