protected void adjustForNumColumns(int numColumns) {
   Control control = getLabelComposite();
   ((GridData) control.getLayoutData()).horizontalSpan = numColumns;
   ((GridData) list.getLayoutData()).horizontalSpan = numColumns - 1;
 }
Example #2
0
  void initWidgets() {
    GlobalConfWinLab = new Label(MainShell, SWT.NORMAL | SWT.CENTER);
    GlobalUsersGroup = new Group(MainShell, SWT.NONE);
    GlobalOutWin = new Text(MainShell, SWT.MULTI | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL);

    GlobalUsersList = new List(GlobalUsersGroup, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);

    GlobalInpWinLab = new Label(MainShell, SWT.NORMAL | SWT.CENTER);
    GlobalInpWin = new Text(MainShell, SWT.MULTI | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL);
    GlobalSendBut = new Button(MainShell, SWT.PUSH);
    GlobalClearBut = new Button(MainShell, SWT.PUSH);

    GlobalMainMenu = new Menu(MainShell, SWT.BAR);
    GlobalOptionsMenu = new Menu(MainShell, SWT.DROP_DOWN);
    GlobalSettingsMenu = new Menu(MainShell, SWT.DROP_DOWN);
    GlobalProfileMenu = new Menu(MainShell, SWT.DROP_DOWN);

    GlobalProfileItem = new MenuItem(GlobalSettingsMenu, SWT.CASCADE);
    GlobalOptionsItem = new MenuItem(GlobalMainMenu, SWT.CASCADE);

    GlobalOptionsItem.setMenu(GlobalOptionsMenu);
    GlobalSettingsItem = new MenuItem(GlobalMainMenu, SWT.CASCADE);
    GlobalSettingsItem.setMenu(GlobalSettingsMenu);
    GlobalProfileItem.setMenu(GlobalProfileMenu);
    GlobalExitItem = new MenuItem(GlobalOptionsMenu, SWT.CASCADE);
    GlobalConnectionItem = new MenuItem(GlobalSettingsMenu, SWT.CASCADE);
    GlobalUserNameItem = new MenuItem(GlobalSettingsMenu, SWT.CASCADE);
    GlobalAboutItem = new MenuItem(GlobalMainMenu, SWT.CASCADE);
    GlobalServerItem = new MenuItem(GlobalProfileMenu, SWT.RADIO);
    GlobalClientItem = new MenuItem(GlobalProfileMenu, SWT.RADIO);

    GlobalConfWinLab.setText("Conference window:");
    GlobalOutWin.setText("");
    GlobalInpWinLab.setText("Input Window:");
    GlobalInpWin.setText("");
    GlobalSendBut.setText("Send");
    GlobalClearBut.setText("Clear");
    GlobalOptionsItem.setText("Options");
    GlobalSettingsItem.setText("Settings");
    GlobalProfileItem.setText("Profile");
    GlobalExitItem.setText("Exit");
    GlobalConnectionItem.setText("Connection");
    GlobalUserNameItem.setText("User");
    GlobalAboutItem.setText("About");
    GlobalServerItem.setText("Server");
    GlobalClientItem.setText("Client");
    GlobalUsersGroup.setText("Online Users");

    GlobalOutWin.setFont(Calibri);
    GlobalInpWin.setFont(Calibri);
    GlobalSendBut.setFont(Calibri);
    GlobalClearBut.setFont(Calibri);
    GlobalUsersGroup.setFont(Calibri);
    GlobalUsersList.setFont(Calibri);
    GlobalConfWinLab.setFont(Calibri);
    GlobalInpWinLab.setFont(Calibri);

    GlobalOutWin.setBackground(White);
    GlobalInpWin.setBackground(White);

    GlobalConfWinLab.setLayoutData(
        new GridData(SWT.CENTER | SWT.FILL, SWT.CENTER | SWT.FILL, true, true, 2, 1));
    GlobalOutWin.setLayoutData(
        new GridData(SWT.CENTER | SWT.FILL, SWT.CENTER | SWT.FILL, true, true, 2, 1));
    ((GridData) GlobalOutWin.getLayoutData()).widthHint = 300;
    ((GridData) GlobalOutWin.getLayoutData()).heightHint = 200;

    GlobalInpWinLab.setLayoutData(
        new GridData(SWT.CENTER | SWT.FILL, SWT.CENTER | SWT.FILL, true, true, 2, 1));
    GlobalInpWin.setLayoutData(
        new GridData(SWT.CENTER | SWT.FILL, SWT.CENTER | SWT.FILL, true, true, 1, 2));
    ((GridData) GlobalInpWin.getLayoutData()).widthHint = 250;
    ((GridData) GlobalInpWin.getLayoutData()).heightHint = 100;
    GlobalSendBut.setLayoutData(
        new GridData(SWT.CENTER | SWT.FILL, SWT.CENTER | SWT.FILL, true, true, 1, 1));
    ((GridData) GlobalSendBut.getLayoutData()).widthHint = 50;
    ((GridData) GlobalSendBut.getLayoutData()).heightHint = 30;
    GlobalClearBut.setLayoutData(
        new GridData(SWT.CENTER | SWT.FILL, SWT.CENTER | SWT.FILL, true, true, 1, 1));
    ((GridData) GlobalClearBut.getLayoutData()).widthHint = 50;
    ((GridData) GlobalClearBut.getLayoutData()).heightHint = 30;
    GlobalUsersGroup.setLayoutData(new GridData(SWT.CENTER | SWT.FILL, SWT.FILL, true, true, 1, 5));
    ((GridData) GlobalUsersGroup.getLayoutData()).widthHint = 150;
    ((GridData) GlobalUsersGroup.getLayoutData()).heightHint = 300;

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

    GlobalUsersList.setLayoutData(new GridData(GridData.FILL_BOTH));
    ((GridData) GlobalUsersList.getLayoutData()).widthHint = 150;
    ((GridData) GlobalUsersList.getLayoutData()).heightHint = 300;

    GlobalOutWin.setEditable(false);

    GlobalInpWin.setFocus();

    if (UserProfile == JTC.SERVER) GlobalServerItem.setSelection(true);
    else GlobalClientItem.setSelection(true);
  }