예제 #1
0
  public void buildView(List<String> files) {
    this.files = files;

    display = new Display();
    shell = new Shell(display);
    shell.setText("Ebook converter");
    shell.setSize(300, 400);

    list = new org.eclipse.swt.widgets.List(shell, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL);
    list.setBounds(40, 20, 220, 100);
    label = new Label(shell, SWT.BORDER);
    label.setBounds(60, 130, 160, 25);
    label.setText("Converted:");
    listConverted = new org.eclipse.swt.widgets.List(shell, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL);
    listConverted.setBounds(40, 170, 220, 100);
    updateList();

    list.addListener(SWT.DefaultSelection, this);
    listConverted.addListener(
        SWT.DefaultSelection,
        new Listener() {
          public void handleEvent(Event event) {
            try {
              int i = listConverted.getSelectionIndices()[0];
              System.err.println(i);
              Runtime.getRuntime().exec(pdfViewer + " " + listConverted.getItem(i));
            } catch (IOException e) {
              e.printStackTrace();
            }
          }
        });
  }
예제 #2
0
 void layout() {
   Rectangle rect = shell.getClientArea();
   // String[] strings = new String[objects.length];
   int width = 0;
   String[] items = list.getItems();
   GC gc = new GC(list);
   for (int i = 0; i < objects.length; i++) {
     width = Math.max(width, gc.stringExtent(items[i]).x);
   }
   gc.dispose();
   Point size1 = start.computeSize(SWT.DEFAULT, SWT.DEFAULT);
   Point size2 = stop.computeSize(SWT.DEFAULT, SWT.DEFAULT);
   Point size3 = check.computeSize(SWT.DEFAULT, SWT.DEFAULT);
   Point size4 = label.computeSize(SWT.DEFAULT, SWT.DEFAULT);
   width = Math.max(size1.x, Math.max(size2.x, Math.max(size3.x, width)));
   width = Math.max(64, Math.max(size4.x, list.computeSize(width, SWT.DEFAULT).x));
   start.setBounds(0, 0, width, size1.y);
   stop.setBounds(0, size1.y, width, size2.y);
   check.setBounds(0, size1.y + size2.y, width, size3.y);
   label.setBounds(0, rect.height - size4.y, width, size4.y);
   int height = size1.y + size2.y + size3.y;
   list.setBounds(0, height, width, rect.height - height - size4.y);
   text.setBounds(width, 0, rect.width - width, rect.height);
   canvas.setBounds(width, 0, rect.width - width, rect.height);
 }
  /** Create contents of the window. */
  protected void createContents() {
    shlMcScheduler = new Shell();
    shlMcScheduler.setSize(803, 401);
    shlMcScheduler.setText("MC3 Scheduler");

    // MENU BAR
    Menu MenuBar = new Menu(shlMcScheduler, SWT.BAR);
    shlMcScheduler.setMenuBar(MenuBar);

    // FILE
    MenuItem FileMenu = new MenuItem(MenuBar, SWT.CASCADE);
    FileMenu.setText("File");

    Menu FileCascade = new Menu(FileMenu);
    FileMenu.setMenu(FileCascade);

    MenuItem mntmSave = new MenuItem(FileCascade, SWT.NONE);
    mntmSave.setText("Save");

    MenuItem mntmOpen = new MenuItem(FileCascade, SWT.NONE);
    mntmOpen.setText("Open");

    MenuItem mntmExit = new MenuItem(FileCascade, SWT.NONE);
    mntmExit.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            shlMcScheduler.close();
          }
        });
    mntmExit.setText("Exit");

    // EDIT
    MenuItem EditMenu = new MenuItem(MenuBar, SWT.CASCADE);
    EditMenu.setText("Edit");

    Menu EditCascade = new Menu(EditMenu);
    EditMenu.setMenu(EditCascade);

    // INSERT
    MenuItem InsertMenu = new MenuItem(MenuBar, SWT.CASCADE);
    InsertMenu.setText("Insert");

    Menu InsertCascade = new Menu(InsertMenu);
    InsertMenu.setMenu(InsertCascade);

    MenuItem InsertTranscript = new MenuItem(InsertCascade, SWT.NONE);
    InsertTranscript.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            final InsertDialog dial = new InsertDialog(shlMcScheduler, 1, txtXscript);
            dial.open();
          }
        });
    InsertTranscript.setText("Insert Transcript");

    MenuItem InsertCoursePlan = new MenuItem(InsertCascade, SWT.NONE);
    InsertCoursePlan.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            final InsertDialog dial = new InsertDialog(shlMcScheduler, 1, txtCoursePlan);
            dial.open();
          }
        });
    InsertCoursePlan.setText("Insert Course Plan");

    MenuItem InsertCourseList = new MenuItem(InsertCascade, SWT.NONE);
    InsertCourseList.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {}
        });
    InsertCourseList.setText("Insert a Course List");

    // WINDOW TABS
    TabFolder WindowTab = new TabFolder(shlMcScheduler, SWT.NONE);
    WindowTab.setBounds(0, 0, 565, 343);

    // TRANSCRIPT TAB
    TabItem TranscriptTab = new TabItem(WindowTab, SWT.NONE);
    TranscriptTab.setText("Transcript");

    Composite TranscriptWindow = new Composite(WindowTab, SWT.NONE);
    TranscriptTab.setControl(TranscriptWindow);

    txtXscript =
        new Text(
            TranscriptWindow,
            SWT.BORDER | SWT.READ_ONLY | SWT.H_SCROLL | SWT.V_SCROLL | SWT.CANCEL);
    txtXscript.setEditable(false);
    txtXscript.setText("Insert your Transcript!");
    txtXscript.setBounds(0, 0, 557, 315);

    // COURSE PLAN TAB
    TabItem CoursePlanTab = new TabItem(WindowTab, SWT.NONE);
    CoursePlanTab.setText("Course Plan");

    Composite CoursePlanWindow = new Composite(WindowTab, SWT.NONE);
    CoursePlanTab.setControl(CoursePlanWindow);

    txtCoursePlan =
        new Text(
            CoursePlanWindow,
            SWT.BORDER | SWT.READ_ONLY | SWT.H_SCROLL | SWT.V_SCROLL | SWT.CANCEL);
    txtCoursePlan.setText("Insert your Course Plan");
    txtCoursePlan.setEditable(false);
    txtCoursePlan.setBounds(0, 0, 557, 315);

    // COURSE LIST TAB
    TabItem CourseListTab = new TabItem(WindowTab, SWT.NONE);
    CourseListTab.setText("Course List");

    Composite CourseListWindow = new Composite(WindowTab, SWT.NONE);
    CourseListTab.setControl(CourseListWindow);

    final List cList = new List(CourseListWindow, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
    cList.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            currentCourseSelected = cList.getSelection()[0];
          }
        });
    cList.setBounds(0, 0, 557, 315);
    cList.add("MATH TEST");
    cList.add("SCIENCE TEST");

    TabItem CalendarTab = new TabItem(WindowTab, SWT.NONE);
    CalendarTab.setText("Calendar");

    Composite CalenderWindow = new Composite(WindowTab, SWT.NONE);
    CalenderWindow.setEnabled(false);
    CalendarTab.setControl(CalenderWindow);

    table = new Table(CalenderWindow, SWT.BORDER | SWT.FULL_SELECTION);
    table.setBounds(0, 0, 557, 315);
    table.setHeaderVisible(true);
    table.setLinesVisible(true);

    TableColumn SunColumn = new TableColumn(table, SWT.NONE);
    SunColumn.setWidth(79);
    SunColumn.setText("Sunday");

    TableColumn MonColumn = new TableColumn(table, SWT.NONE);
    MonColumn.setWidth(79);
    MonColumn.setText("Monday");

    TableColumn TueColumn = new TableColumn(table, SWT.NONE);
    TueColumn.setWidth(79);
    TueColumn.setText("Tuesday");

    TableColumn WedsColumn = new TableColumn(table, SWT.NONE);
    WedsColumn.setWidth(79);
    WedsColumn.setText("Wednesday");

    TableColumn ThuColumn = new TableColumn(table, SWT.NONE);
    ThuColumn.setWidth(79);
    ThuColumn.setText("Thursday");

    TableColumn FriColumn = new TableColumn(table, SWT.NONE);
    FriColumn.setWidth(79);
    FriColumn.setText("Friday");

    TableColumn SatColumn = new TableColumn(table, SWT.NONE);
    SatColumn.setWidth(79);
    SatColumn.setText("Saturday");

    //
    Label LabelSelectedCourses = new Label(shlMcScheduler, SWT.NONE);
    LabelSelectedCourses.setLocation(621, 2);
    LabelSelectedCourses.setSize(112, 15);
    LabelSelectedCourses.setText("Selected Courses");

    Composite SelectedCoursesWindow = new Composite(shlMcScheduler, SWT.NONE);
    SelectedCoursesWindow.setBounds(571, 23, 206, 310);

    final List selectedList = new List(SelectedCoursesWindow, SWT.BORDER);
    selectedList.setBounds(0, 0, 206, 269);
    selectedList.add("No Courses Selected");

    Button btnRemoveCourse = new Button(SelectedCoursesWindow, SWT.NONE);
    btnRemoveCourse.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mouseUp(MouseEvent e) {
            try {
              removeCurrentCourse(selectedList, selectedList.getSelection()[0]);
            } catch (ArrayIndexOutOfBoundsException error) {
              final ErrorDialog err = new ErrorDialog(shlMcScheduler, 1);
              err.open();
            }
          }
        });
    btnRemoveCourse.setBounds(111, 275, 95, 25);
    btnRemoveCourse.setText("Remove Course");

    Button btnAddCourse = new Button(SelectedCoursesWindow, SWT.NONE);
    btnAddCourse.setBounds(0, 275, 95, 25);
    btnAddCourse.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mouseUp(MouseEvent e) {
            try {
              addCurrentCourse(selectedList, cList.getSelection()[0]);
            } catch (ArrayIndexOutOfBoundsException error) {
              final ErrorDialog err = new ErrorDialog(shlMcScheduler, 1);
              err.open();
            }
          }
        });
    btnAddCourse.setText("Add Course");
  }
  /** Open the window. */
  public void open() {
    display = Display.getDefault();
    shlSenderWindow = new Shell();
    shlSenderWindow.setSize(373, 600);
    shlSenderWindow.setText("Receiver Window");

    Label senderNameLabel = new Label(shlSenderWindow, SWT.NONE);
    senderNameLabel.setBounds(23, 146, 111, 17);
    senderNameLabel.setText("Sender Name");

    senderNameText = new Text(shlSenderWindow, SWT.BORDER);
    senderNameText.setBounds(155, 136, 183, 27);

    Label recepientNameLabel = new Label(shlSenderWindow, SWT.NONE);
    recepientNameLabel.setBounds(23, 182, 111, 17);
    recepientNameLabel.setText("Recepient Name");

    recepientNameText = new Text(shlSenderWindow, SWT.BORDER);
    recepientNameText.setBounds(155, 172, 183, 27);

    Label TicketIdLabel = new Label(shlSenderWindow, SWT.NONE);
    TicketIdLabel.setBounds(23, 215, 111, 17);
    TicketIdLabel.setText("Ticket ID");

    messageIDText = new Text(shlSenderWindow, SWT.BORDER);
    messageIDText.setBounds(155, 205, 183, 27);

    Label ticketLabel = new Label(shlSenderWindow, SWT.NONE);
    ticketLabel.setBounds(23, 251, 70, 17);
    ticketLabel.setText("Ticket");

    ticketText = new StyledText(shlSenderWindow, SWT.BORDER);
    ticketText.setBounds(10, 287, 347, 183);

    closeButton = new Button(shlSenderWindow, SWT.NONE);
    closeButton.setBounds(233, 532, 105, 29);
    closeButton.setText("Close");
    closeButton.addSelectionListener(this);

    queueList = new List(shlSenderWindow, SWT.V_SCROLL | SWT.H_SCROLL);
    queueList.setBounds(23, 33, 111, 92);

    Label queueToConnectLabel = new Label(shlSenderWindow, SWT.NONE);
    queueToConnectLabel.setBounds(10, 10, 124, 17);
    queueToConnectLabel.setText("Queue to connect");

    retrieveMessageButton = new Button(shlSenderWindow, SWT.NONE);
    retrieveMessageButton.setBounds(191, 65, 122, 29);
    retrieveMessageButton.setText("Retrieve Message");
    retrieveMessageButton.addSelectionListener(this);

    UpdateExchangeList(MessageReceiverHighLevelClass.GetQueueList());

    shlSenderWindow.open();
    shlSenderWindow.layout();
    while (!shlSenderWindow.isDisposed()) {
      if (!display.readAndDispatch()) {
        display.sleep();
      }
    }
  }
  public SegmentsForReviewList(Composite parent, int style, Player player, int lastScrn) {
    super(parent, style);

    this.lastScreen = lastScrn;

    Label lblSegmentsList = new Label(this, SWT.BORDER);
    lblSegmentsList.setText("Segments List");
    lblSegmentsList.setFont(SWTResourceManager.getFont("Segoe UI", 14, SWT.BOLD));
    lblSegmentsList.setAlignment(SWT.CENTER);
    lblSegmentsList.setBounds(10, 10, 194, 30);

    Button backBtn = new Button(this, SWT.NONE);
    backBtn.setImage(
        SWTResourceManager.getImage(SegmentsForReviewList.class, "/codereview/assets/back.png"));
    backBtn.setBounds(210, 13, 25, 25);
    backBtn.addListener(
        SWT.Selection,
        new Listener() {

          @Override
          public void handleEvent(Event arg0) {
            setVisible(false);
            if (lastScreen == Cons.MAIN_MENU_SCREEN) {
              MainScreen.initializeMainMenu();
            } else if (lastScreen == Cons.CREATOR_MODE_SCREEN) {
              MainScreen.initializeCreatorScreen();
            }
          }
        });

    Label explainLbl = new Label(this, SWT.NONE);
    explainLbl.setBounds(10, 46, 225, 55);
    explainLbl.setText("Explaination about what to do...");

    segments = null;
    String[] items = null;
    try {
      segments = MainScreen.handler.getSegmentsForReviewByPlayer(player);
    } catch (Exception e) {
      e.printStackTrace();
    }
    list = new List(this, SWT.BORDER | SWT.V_SCROLL);
    list.setFont(SWTResourceManager.getFont("Segoe UI", 10, SWT.NORMAL));
    list.setBounds(10, 107, 225, 251);
    if (segments == null) {
      explainLbl.setText("Error loading data...");
    } else if (segments.length == 0) {
      explainLbl.setText("No new segments to review...");
    } else {
      items = new String[segments.length];
      for (int i = 0; i < segments.length; i++) {
        items[i] = segments[i].getCode();
      }

      list.setItems(items);
      list.addListener(
          SWT.MouseDoubleClick,
          new Listener() {

            @Override
            public void handleEvent(Event arg0) {
              int[] selected = list.getSelectionIndices();
              setVisible(false);
              MainScreen.initializeReviewerScreen(segments[selected[0]]);
            }
          });
    }
  }
예제 #6
0
  public VConnect(Composite parent, int style, StringProvider stringProvider) {
    super(parent, style);
    _stringProvider = stringProvider;
    setLayout(null);

    Group grpConnection = new Group(this, SWT.NONE);
    grpConnection.setBounds(0, 0, 260, 225);

    Label lblServers = new Label(grpConnection, SWT.NONE);
    lblServers.setBounds(10, 27, 59, 14);
    lblServers.setText("Servers");

    btnPing = new Button(grpConnection, SWT.FLAT);
    btnPing.setBounds(10, 3, 47, 21);
    btnPing.setText("Ping");

    Label lblScenarios = new Label(grpConnection, SWT.NONE);
    lblScenarios.setText("Scenarios");
    lblScenarios.setBounds(106, 27, 59, 14);

    Label lblParticipants = new Label(grpConnection, SWT.NONE);
    lblParticipants.setText("Participants");
    lblParticipants.setBounds(10, 113, 67, 14);

    partViewer = new TableViewer(grpConnection, SWT.BORDER | SWT.FULL_SELECTION);
    partTable = partViewer.getTable();
    partTable.setBounds(10, 129, 240, 81);

    TableViewerColumn nameCol = new TableViewerColumn(partViewer, SWT.NONE);
    TableColumn colName = nameCol.getColumn();
    colName.setWidth(50);
    colName.setText("Name");

    TableViewerColumn catCol = new TableViewerColumn(partViewer, SWT.NONE);
    TableColumn colCategory = catCol.getColumn();
    colCategory.setWidth(100);
    colCategory.setText("Category");

    TableViewerColumn actCol = new TableViewerColumn(partViewer, SWT.NONE);
    TableColumn colActivity = actCol.getColumn();
    colActivity.setWidth(100);
    colActivity.setText("Activity");

    listServerViewer = new ListViewer(grpConnection, SWT.BORDER | SWT.V_SCROLL);
    listServers = listServerViewer.getList();
    listServers.setBounds(10, 41, 100, 66);

    listScenarioViewer = new ListViewer(grpConnection, SWT.BORDER | SWT.V_SCROLL);
    listScenarios = listScenarioViewer.getList();
    listScenarios.setBounds(116, 41, 130, 66);

    btnDisconnect = new Button(grpConnection, SWT.FLAT);
    btnDisconnect.setText("Disconnect");
    btnDisconnect.setBounds(171, 10, 79, 31);

    btnSelfHost = new Button(grpConnection, SWT.CHECK);
    btnSelfHost.setBounds(76, 5, 79, 18);
    btnSelfHost.setText("Self host");

    // btnManual = new Button(grpConnection, SWT.FLAT);
    // btnManual.setBounds(63, 3, 67, 21);
    // btnManual.setText("Manual");

  }
예제 #7
0
  /**
   * Create the shell.
   *
   * @param display
   */
  public AdministratorShell(Display display) {
    super(display, SWT.SHELL_TRIM);
    setImage(
        SWTResourceManager.getImage(AdministratorShell.class, "/com/hms/icon/hms-admin-icon.png"));

    Group grpNgiSDng = new Group(this, SWT.NONE);
    grpNgiSDng.setText(Messages.getString("HMS.AdministratorShell.group.user"));
    grpNgiSDng.setBounds(10, 10, 216, 319);

    List list = new List(grpNgiSDng, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
    list.setFont(SWTResourceManager.getFont("Times New Roman", 12, SWT.NORMAL));
    list.setItems(
        new String[] {
          "Nguyễn Văn A0",
          "Nguyễn Văn B0",
          "Nguyễn Văn C0",
          "Nguyễn Văn A",
          "Nguyễn Văn B",
          "Nguyễn Văn C",
          "Nguyễn Văn A",
          "Nguyễn Văn B",
          "Nguyễn Văn C",
          "Nguyễn Văn A",
          "Nguyễn Văn B",
          "Nguyễn Văn C",
          "Nguyễn Văn A",
          "Nguyễn Văn B",
          "Nguyễn Văn C1",
          "Nguyễn Văn A1",
          "Nguyễn Văn B2",
          "Nguyễn Văn C2"
        });
    list.setBounds(10, 20, 196, 289);

    Group grpThngTinNgi = new Group(this, SWT.NONE);
    grpThngTinNgi.setText(Messages.getString("HMS.AdministratorShell.group.user_info"));
    grpThngTinNgi.setBounds(232, 10, 650, 213);

    Label lblTnngNhp = new Label(grpThngTinNgi, SWT.NONE);
    lblTnngNhp.setFont(SWTResourceManager.getFont("Times New Roman", 12, SWT.BOLD));
    lblTnngNhp.setBounds(10, 33, 136, 21);
    lblTnngNhp.setText(Messages.getString("HMS.AdministratorShell.group.user_info.label.username"));

    text = new Text(grpThngTinNgi, SWT.BORDER);
    text.addFocusListener(
        new FocusAdapter() {
          @Override
          public void focusGained(FocusEvent e) {
            text.selectAll();
          }
        });
    text.setBounds(152, 33, 251, 21);
    text.setFocus();
    text.setTopIndex(0);

    Label lblMtKhu = new Label(grpThngTinNgi, SWT.NONE);
    lblMtKhu.setText(Messages.getString("HMS.AdministratorShell.group.user_info.label.password"));
    lblMtKhu.setFont(SWTResourceManager.getFont("Times New Roman", 12, SWT.BOLD));
    lblMtKhu.setBounds(10, 60, 136, 21);

    text_1 = new Text(grpThngTinNgi, SWT.BORDER | SWT.PASSWORD);
    text_1.setBounds(152, 60, 251, 21);
    text_1.setTopIndex(1);

    Label lblXcNhnMt = new Label(grpThngTinNgi, SWT.NONE);
    lblXcNhnMt.setText(
        Messages.getString("HMS.AdministratorShell.group.user_info.label.confirm_password"));
    lblXcNhnMt.setFont(SWTResourceManager.getFont("Times New Roman", 12, SWT.BOLD));
    lblXcNhnMt.setBounds(10, 87, 136, 21);

    text_2 = new Text(grpThngTinNgi, SWT.BORDER | SWT.PASSWORD);
    text_2.setBounds(152, 87, 251, 21);
    text_2.setTopIndex(2);

    Label label = new Label(grpThngTinNgi, SWT.SEPARATOR | SWT.HORIZONTAL);
    label.setBounds(0, 114, 650, 2);

    Label lblTny = new Label(grpThngTinNgi, SWT.NONE);
    lblTny.setText(Messages.getString("HMS.AdministratorShell.group.user_info.label.fullname"));
    lblTny.setFont(SWTResourceManager.getFont("Times New Roman", 12, SWT.BOLD));
    lblTny.setBounds(10, 122, 136, 21);

    text_3 = new Text(grpThngTinNgi, SWT.BORDER);
    text_3.setBounds(152, 122, 251, 21);
    text_3.setTopIndex(3);

    Label lblEmail = new Label(grpThngTinNgi, SWT.NONE);
    lblEmail.setText(Messages.getString("HMS.AdministratorShell.group.user_info.label.email"));
    lblEmail.setFont(SWTResourceManager.getFont("Times New Roman", 12, SWT.BOLD));
    lblEmail.setBounds(10, 149, 136, 21);

    text_4 = new Text(grpThngTinNgi, SWT.BORDER);
    text_4.setBounds(152, 149, 251, 21);
    text_4.setTopIndex(4);

    Label lblHnhnh = new Label(grpThngTinNgi, SWT.NONE);
    lblHnhnh.setText(Messages.getString("HMS.AdministratorShell.group.user_info.label.picture"));
    lblHnhnh.setFont(SWTResourceManager.getFont("Times New Roman", 12, SWT.BOLD));
    lblHnhnh.setBounds(10, 176, 136, 21);

    text_5 = new Text(grpThngTinNgi, SWT.BORDER);
    text_5.setBounds(152, 176, 251, 21);
    text_5.setTopIndex(5);

    Group grpQuynSDng = new Group(this, SWT.NONE);
    grpQuynSDng.setText(Messages.getString("HMS.AdministratorShell.group.user_privileges"));
    grpQuynSDng.setBounds(232, 229, 650, 370);

    Label lblNhmChcNng = new Label(grpQuynSDng, SWT.NONE);
    lblNhmChcNng.setFont(SWTResourceManager.getFont("Times New Roman", 12, SWT.BOLD));
    lblNhmChcNng.setBounds(10, 27, 120, 21);
    lblNhmChcNng.setText(
        Messages.getString("HMS.AdministratorShell.group.user_privileges.label.group_function"));

    final List list_1 = new List(grpQuynSDng, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
    list_1.setTopIndex(6);

    final java.util.List<LinkedList<String>> list_2_model = new LinkedList<LinkedList<String>>();
    LinkedList<String> tempList = new LinkedList<String>();
    tempList.add("Sử dụng CN 1");
    tempList.add("Thêm CN 1");
    tempList.add("Xóa CN 1");

    list_2_model.add(tempList);

    tempList = new LinkedList<String>();
    tempList.add("Thêm CN 2");
    tempList.add("Xóa CN 2");

    list_2_model.add(tempList);

    final java.util.List<LinkedList<String>> list_3_model = new LinkedList<LinkedList<String>>();
    list_3_model.add(new LinkedList<String>());
    list_3_model.add(new LinkedList<String>());

    final List list_2 = new List(grpQuynSDng, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI);
    list_2.setTopIndex(7);
    final List list_3 = new List(grpQuynSDng, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI);
    list_3.setTopIndex(12);

    list_1.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            List list = (List) e.widget;
            int[] selectedItems = list.getSelectionIndices();
            list_2.removeAll();
            list_3.removeAll();

            if (selectedItems.length == 1) {
              switch (selectedItems[0]) {
                case 0:
                  for (String item : list_2_model.get(0)) {
                    list_2.add(item);
                  }

                  for (String item : list_3_model.get(0)) {
                    list_3.add(item);
                  }

                  break;
                case 1:
                  for (String item : list_2_model.get(1)) {
                    list_2.add(item);
                  }

                  for (String item : list_3_model.get(1)) {
                    list_3.add(item);
                  }

                  break;
              }
            }
          }
        });
    list_1.setItems(new String[] {"Chức năng 1", "Chức năng 2"});
    list_1.setBounds(10, 54, 178, 306);

    Label label_2 = new Label(grpQuynSDng, SWT.SEPARATOR | SWT.VERTICAL);
    label_2.setBounds(204, 10, 2, 357);

    Label lblCcQuynSn = new Label(grpQuynSDng, SWT.NONE);
    lblCcQuynSn.setText(
        Messages.getString("HMS.AdministratorShell.group.user_privileges.label.privileges"));
    lblCcQuynSn.setFont(SWTResourceManager.getFont("Times New Roman", 12, SWT.BOLD));
    lblCcQuynSn.setBounds(220, 27, 120, 21);

    list_2.setBounds(220, 54, 178, 306);

    Label lblCcQuync = new Label(grpQuynSDng, SWT.NONE);
    lblCcQuync.setText(
        Messages.getString("HMS.AdministratorShell.group.user_privileges.label.used_privileges"));
    lblCcQuync.setFont(SWTResourceManager.getFont("Times New Roman", 12, SWT.BOLD));
    lblCcQuync.setBounds(462, 27, 165, 21);

    Button button = new Button(grpQuynSDng, SWT.NONE);
    button.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            LinkedList<String> temp = new LinkedList<String>();

            for (int selectedIndex : list_2.getSelectionIndices()) {
              list_3_model.get(list_1.getSelectionIndex()).add(list_2.getItem(selectedIndex));
              list_3.add(list_2.getItem(selectedIndex));

              temp.add(list_2_model.get(list_1.getSelectionIndex()).get(selectedIndex));
            }

            // Set selected items on destination list
            list_3.setSelection(
                list_3.getItemCount() - list_2.getSelectionCount(), list_3.getItemCount());

            // Remove on source list
            list_2.remove(list_2.getSelectionIndices());

            for (String removedItem : temp) {
              list_2_model.get(list_1.getSelectionIndex()).remove(removedItem);
            }
          }
        });
    button.setText(">");
    button.setBounds(411, 125, 37, 30);

    Button button_1 = new Button(grpQuynSDng, SWT.NONE);
    button_1.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            LinkedList<String> temp = new LinkedList<String>();

            for (int selectedIndex : list_3.getSelectionIndices()) {
              list_2_model.get(list_1.getSelectionIndex()).add(list_3.getItem(selectedIndex));
              list_2.add(list_3.getItem(selectedIndex));

              temp.add(list_3_model.get(list_1.getSelectionIndex()).get(selectedIndex));
            }

            // Set selected items on destination list
            list_2.setSelection(
                list_2.getItemCount() - list_3.getSelectionCount(), list_2.getItemCount());

            // Remove on source list
            list_3.remove(list_3.getSelectionIndices());

            for (String removedItem : temp) {
              list_3_model.get(list_1.getSelectionIndex()).remove(removedItem);
            }
          }
        });
    button_1.setText("<");
    button_1.setBounds(411, 170, 37, 30);

    Button button_2 = new Button(grpQuynSDng, SWT.NONE);
    button_2.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            for (int i = 0; i < list_2.getItemCount(); i++) {
              list_3_model.get(list_1.getSelectionIndex()).add(list_2.getItem(i));
              list_3.add(list_2.getItem(i));
            }

            // Select all items of destination list
            list_3.selectAll();

            // Remove source list
            list_2.removeAll();
            list_2_model.get(list_1.getSelectionIndex()).clear();
          }
        });
    button_2.setText(">>");
    button_2.setBounds(411, 215, 37, 30);

    Button button_3 = new Button(grpQuynSDng, SWT.NONE);
    button_3.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            for (int i = 0; i < list_3.getItemCount(); i++) {
              list_2_model.get(list_1.getSelectionIndex()).add(list_3.getItem(i));
              list_2.add(list_3.getItem(i));
            }

            // Select all items of destination list
            list_2.selectAll();

            // Remove source list
            list_3.removeAll();
            list_3_model.get(list_1.getSelectionIndex()).clear();
          }
        });
    button_3.setToolTipText("");
    button_3.setText("<<");
    button_3.setBounds(411, 260, 37, 30);

    list_3.setBounds(462, 54, 178, 306);

    Composite composite = new Composite(this, SWT.BORDER);
    composite.setBounds(232, 605, 650, 55);

    Button btnLu = new Button(composite, SWT.NONE);
    btnLu.setImage(
        SWTResourceManager.getImage(AdministratorShell.class, "/com/hms/icon/hms-save-icon.png"));
    btnLu.setFont(SWTResourceManager.getFont("Times New Roman", 12, SWT.BOLD));
    btnLu.setText(Messages.getString("HMS.AdministratorShell.button.save"));
    btnLu.setBounds(350, 10, 110, 30);

    Button btnHy = new Button(composite, SWT.NONE);
    btnHy.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            dispose();
          }
        });
    btnHy.setImage(
        SWTResourceManager.getImage(AdministratorShell.class, "/com/hms/icon/hms-cancel-icon.png"));
    btnHy.setFont(SWTResourceManager.getFont("Times New Roman", 12, SWT.BOLD));
    btnHy.setBounds(500, 10, 110, 30);
    btnHy.setText(Messages.getString("HMS.AdministratorShell.button.cancel"));

    Button btnThmMi = new Button(composite, SWT.NONE);
    btnThmMi.setImage(
        SWTResourceManager.getImage(AdministratorShell.class, "/com/hms/icon/hms-add-icon.png"));
    btnThmMi.setEnabled(false);
    btnThmMi.setFont(SWTResourceManager.getFont("Times New Roman", 12, SWT.BOLD));
    btnThmMi.setText(Messages.getString("HMS.AdministratorShell.button.add"));
    btnThmMi.setBounds(200, 10, 110, 30);
    createContents();
  }