/** 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");
  }
Exemplo n.º 2
0
  /** @wbp.parser.entryPoint */
  public void showType2Document() {
    final Display display = Display.getDefault();

    shlTypeDocument = new Shell(display);
    shlTypeDocument.setText("Type 2 Document");
    shlTypeDocument.setSize(780, 634);
    shlTypeDocument.setLocation(display.getBounds().x + 200, display.getBounds().y + 100);

    Composite composite = new Composite(shlTypeDocument, SWT.NONE);
    composite.setBounds(0, 0, 759, 557);

    TabFolder tabFolder = new TabFolder(composite, SWT.NONE);
    tabFolder.setBounds(10, 10, 742, 545);

    TabItem tbtmText = new TabItem(tabFolder, SWT.NONE);
    tbtmText.setText("Text");

    Group grpText = new Group(tabFolder, SWT.NONE);
    grpText.setText("Text");
    tbtmText.setControl(grpText);
    // The first tab!  --> Text
    Label lblLeadingIndentionOf = new Label(grpText, SWT.NONE);
    lblLeadingIndentionOf.setBounds(10, 82, 374, 15);
    lblLeadingIndentionOf.setText("Leading indention of other paragraph:");

    text = new Text(grpText, SWT.BORDER);
    text.setBounds(422, 79, 76, 21);

    Label lblCharacters = new Label(grpText, SWT.NONE);
    lblCharacters.setBounds(504, 82, 85, 15);
    lblCharacters.setText("characters");

    Label lblSpacingBetweenCharacters = new Label(grpText, SWT.NONE);
    lblSpacingBetweenCharacters.setBounds(10, 116, 374, 15);
    lblSpacingBetweenCharacters.setText("Spacing between paragraphs:");

    text_1 = new Text(grpText, SWT.BORDER);
    text_1.setBounds(422, 113, 76, 21);

    Label lblLines = new Label(grpText, SWT.NONE);
    lblLines.setBounds(504, 116, 85, 15);
    lblLines.setText("lines");

    Label lblstParagraph = new Label(grpText, SWT.NONE);
    lblstParagraph.setBounds(10, 47, 374, 15);
    lblstParagraph.setText("1st Paragraph:");

    text_2 = new Text(grpText, SWT.BORDER);
    text_2.setBounds(422, 47, 76, 21);

    Label label_2 = new Label(grpText, SWT.NONE);
    label_2.setBounds(504, 47, 85, 15);
    label_2.setText("characters");

    Label lblEstimatedAverageLengths = new Label(grpText, SWT.NONE);
    lblEstimatedAverageLengths.setBounds(10, 154, 374, 15);
    lblEstimatedAverageLengths.setText("Estimated average length(s) of a line:");

    text_3 = new Text(grpText, SWT.BORDER);
    text_3.setBounds(422, 148, 76, 21);

    Label label_3 = new Label(grpText, SWT.NONE);
    label_3.setBounds(504, 154, 85, 15);
    label_3.setText("characters");

    Label lblPageNumberForms = new Label(grpText, SWT.NONE);
    lblPageNumberForms.setBounds(10, 194, 141, 15);
    lblPageNumberForms.setText("Page number forms:");

    text_4 = new Text(grpText, SWT.BORDER);
    text_4.setBounds(161, 191, 477, 21);

    Label lblSectionHeadings = new Label(grpText, SWT.NONE);
    lblSectionHeadings.setBounds(10, 237, 141, 15);
    lblSectionHeadings.setText("Section headings:");

    Button btnCapitalized = new Button(grpText, SWT.RADIO);
    btnCapitalized.setBounds(169, 236, 90, 16);
    btnCapitalized.setText("Capitalized");

    Button btnAllCapital = new Button(grpText, SWT.RADIO);
    btnAllCapital.setBounds(263, 237, 90, 16);
    btnAllCapital.setText("ALL CAPITAL");

    text_5 = new Text(grpText, SWT.BORDER);
    text_5.setBounds(366, 231, 272, 21);

    Label lblFooterTokens = new Label(grpText, SWT.NONE);
    lblFooterTokens.setBounds(10, 283, 85, 15);
    lblFooterTokens.setText("Footer tokens:");

    Button btnHasFooters = new Button(grpText, SWT.CHECK);
    btnHasFooters.setBounds(123, 282, 93, 16);
    btnHasFooters.setText("Has footers");

    text_6 = new Text(grpText, SWT.BORDER);
    text_6.setBounds(222, 280, 98, 21);

    Label lblHeaderTokens = new Label(grpText, SWT.NONE);
    lblHeaderTokens.setBounds(337, 283, 85, 15);
    lblHeaderTokens.setText("Header tokens:");

    Button btnHasHeaders = new Button(grpText, SWT.CHECK);
    btnHasHeaders.setBounds(428, 282, 93, 16);
    btnHasHeaders.setText("Has headers");

    text_7 = new Text(grpText, SWT.BORDER);
    text_7.setBounds(523, 277, 98, 21);

    textBean =
        new TextBean(
            text_2,
            text,
            text_1,
            text_3,
            text_4,
            btnCapitalized,
            btnAllCapital,
            text_5,
            new SpecialBean(btnHasFooters, btnHasHeaders, text_6, text_7));

    TabItem tbtmNomenclature = new TabItem(tabFolder, SWT.NONE);
    tbtmNomenclature.setText("Nomenclature");

    Group grpNomenclature = new Group(tabFolder, SWT.NONE);
    grpNomenclature.setText("Nomenclature");
    tbtmNomenclature.setControl(grpNomenclature);

    Label lblWhatIsIn = new Label(grpNomenclature, SWT.NONE);
    lblWhatIsIn.setBounds(10, 28, 111, 15);
    lblWhatIsIn.setText("What is in a name?");

    Label lblFamily = new Label(grpNomenclature, SWT.NONE);
    lblFamily.setBounds(233, 28, 55, 15);
    lblFamily.setText("Family");

    Label lblGenus = new Label(grpNomenclature, SWT.NONE);
    lblGenus.setBounds(399, 28, 55, 15);
    lblGenus.setText("Genus");

    Label lblSpecies = new Label(grpNomenclature, SWT.NONE);
    lblSpecies.setBounds(569, 28, 55, 15);
    lblSpecies.setText("Species");

    nomenScrolledComposite =
        new ScrolledComposite(grpNomenclature, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
    nomenScrolledComposite.setBounds(10, 53, 714, 278);
    nomenScrolledComposite.setExpandHorizontal(true);
    nomenScrolledComposite.setExpandVertical(true);

    nomenclatureGroup = new Group(nomenScrolledComposite, SWT.NONE);
    nomenclatureGroup.setLayoutData(new RowData());

    Label lblName = new Label(nomenclatureGroup, SWT.NONE);
    lblName.setBounds(10, 20, 75, 15);
    lblName.setText("Name");

    Group group_2 = new Group(nomenclatureGroup, SWT.NONE);
    group_2.setBounds(100, 10, 182, 40);

    Button button = new Button(group_2, SWT.RADIO);
    button.setText("Yes");
    button.setBounds(10, 13, 39, 16);

    Button button_1 = new Button(group_2, SWT.RADIO);
    button_1.setText("No");
    button_1.setBounds(55, 13, 39, 16);

    text_14 = new Text(group_2, SWT.BORDER);
    text_14.setBounds(100, 11, 76, 21);
    nomenclatures.put(
        new Integer(nomenCount), new NomenclatureBean(group_2, button, button_1, text_14, lblName));
    nomenCount++;

    Group group_1 = new Group(nomenclatureGroup, SWT.NONE);
    group_1.setBounds(300, 10, 182, 40);

    Button button_2 = new Button(group_1, SWT.RADIO);
    button_2.setText("Yes");
    button_2.setBounds(10, 13, 39, 16);

    Button button_3 = new Button(group_1, SWT.RADIO);
    button_3.setText("No");
    button_3.setBounds(55, 13, 39, 16);

    text_15 = new Text(group_1, SWT.BORDER);
    text_15.setBounds(100, 11, 76, 21);

    nomenclatures.put(
        new Integer(nomenCount),
        new NomenclatureBean(group_1, button_2, button_3, text_15, lblName));
    nomenCount++;

    ///////////////
    Group group_4 = new Group(nomenclatureGroup, SWT.NONE);
    group_4.setBounds(500, 10, 182, 40);

    Button button_4 = new Button(group_4, SWT.RADIO);
    button_4.setText("Yes");
    button_4.setBounds(10, 13, 39, 16);

    Button button_5 = new Button(group_4, SWT.RADIO);
    button_5.setText("No");
    button_5.setBounds(55, 13, 39, 16);

    text_16 = new Text(group_4, SWT.BORDER);
    text_16.setBounds(100, 11, 76, 21);

    nomenclatures.put(
        new Integer(nomenCount),
        new NomenclatureBean(group_4, button_4, button_5, text_16, lblName));
    nomenCount++;

    String[] nomenclatureArray = {"Authors", "Date", "Publication", "Taxon Rank"};
    for (String name : nomenclatureArray) {
      addNomenclatureRow(name);
    }

    nomenScrolledComposite.setContent(nomenclatureGroup);
    // When you add a row, reset the size of scrolledComposite
    nomenScrolledComposite.setMinSize(nomenclatureGroup.computeSize(SWT.DEFAULT, SWT.DEFAULT));

    Button btnAddARow = new Button(grpNomenclature, SWT.NONE);
    btnAddARow.setBounds(10, 337, 75, 25);
    btnAddARow.setText("Add a Row");
    btnAddARow.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            identifier = null;
            showInputBox();
            if (identifier != null && !identifier.equals("")) {
              addNomenclatureRow(identifier);
            }
          }
        });

    TabItem tbtmExpressions = new TabItem(tabFolder, SWT.NONE);
    tbtmExpressions.setText("Expressions");

    Group grpExpressionsUsedIn = new Group(tabFolder, SWT.NONE);
    grpExpressionsUsedIn.setText("Expressions used in Nomenclature");
    tbtmExpressions.setControl(grpExpressionsUsedIn);

    Label lblUseCapLetters = new Label(grpExpressionsUsedIn, SWT.NONE);
    lblUseCapLetters.setBounds(10, 22, 426, 15);
    lblUseCapLetters.setText("Use CAP words for fixed tokens; use small letters for variables");

    Label lblHononyms = new Label(grpExpressionsUsedIn, SWT.NONE);
    lblHononyms.setBounds(348, 22, 99, 15);
    lblHononyms.setText("Hononyms:");

    expScrolledComposite =
        new ScrolledComposite(grpExpressionsUsedIn, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
    expScrolledComposite.setBounds(10, 43, 714, 440);
    expScrolledComposite.setExpandHorizontal(true);
    expScrolledComposite.setExpandVertical(true);

    expressionGroup = new Group(expScrolledComposite, SWT.NONE);
    expressionGroup.setLayoutData(new RowData());

    // count of number of rows
    expCount = 0;
    Label lblSpecialTokensUsed = new Label(expressionGroup, SWT.NONE);
    lblSpecialTokensUsed.setBounds(10, 20, 120, 15);
    lblSpecialTokensUsed.setText("Special tokens used:");

    text_29 = new Text(expressionGroup, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL | SWT.MULTI);
    text_29.setBounds(135, 20, 550, 70);

    expressions.put(new Integer(expCount), new ExpressionBean(lblSpecialTokensUsed, text_29));
    expCount++;

    String[] expressionArray = {"Minor Amendment:", "Past name:", "Name origin:", "Homonyms:"};
    for (String name : expressionArray) {
      addExpressionRow(name);
    }

    expScrolledComposite.setContent(expressionGroup);
    expScrolledComposite.setMinSize(expressionGroup.computeSize(SWT.DEFAULT, SWT.DEFAULT));

    Button btnAddARow_2 = new Button(grpExpressionsUsedIn, SWT.NONE);
    btnAddARow_2.setBounds(10, 489, 75, 25);
    btnAddARow_2.setText("Add a row");
    btnAddARow_2.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            identifier = null;
            showInputBox();
            if (identifier != null && !identifier.equals("")) {
              addExpressionRow(identifier);
            }
          }
        });

    TabItem tbtmDescription = new TabItem(tabFolder, SWT.NONE);
    tbtmDescription.setText("Description");

    Group grpMorphologicalDescriptions = new Group(tabFolder, SWT.NONE);
    tbtmDescription.setControl(grpMorphologicalDescriptions);

    Label lblAllInOne = new Label(grpMorphologicalDescriptions, SWT.NONE);
    lblAllInOne.setBounds(10, 53, 160, 15);
    lblAllInOne.setText("All in one paragraph");

    Button btnYes = new Button(grpMorphologicalDescriptions, SWT.RADIO);
    btnYes.setBounds(241, 52, 90, 16);
    btnYes.setText("Yes");

    Button btnNo = new Button(grpMorphologicalDescriptions, SWT.RADIO);
    btnNo.setBounds(378, 52, 90, 16);
    btnNo.setText("No");

    Label lblOtherInformationMay = new Label(grpMorphologicalDescriptions, SWT.NONE);
    lblOtherInformationMay.setBounds(10, 85, 438, 15);
    lblOtherInformationMay.setText(
        "Other information may also be included in a description paragraph:");

    Combo combo = new Combo(grpMorphologicalDescriptions, SWT.NONE);
    combo.setItems(new String[] {"Nomenclature", "Habitat", "Distribution", "Discussion", "Other"});
    combo.setBounds(496, 82, 177, 23);

    descriptionBean = new DescriptionBean(btnYes, btnNo, combo, sections);

    Label lblMorphological = new Label(grpMorphologicalDescriptions, SWT.NONE);
    lblMorphological.setFont(SWTResourceManager.getFont("Segoe UI", 9, SWT.BOLD));
    lblMorphological.setBounds(10, 25, 242, 15);
    lblMorphological.setText("Morphological Descriptions: ");

    Label lblOrder = new Label(grpMorphologicalDescriptions, SWT.NONE);
    lblOrder.setFont(SWTResourceManager.getFont("Segoe UI", 9, SWT.BOLD));
    lblOrder.setBounds(22, 142, 55, 15);
    lblOrder.setText("Order");

    Label lblSection = new Label(grpMorphologicalDescriptions, SWT.NONE);
    lblSection.setFont(SWTResourceManager.getFont("Segoe UI", 9, SWT.BOLD));
    lblSection.setBounds(140, 142, 55, 15);
    lblSection.setText("Section");

    Label lblStartTokens = new Label(grpMorphologicalDescriptions, SWT.NONE);
    lblStartTokens.setFont(SWTResourceManager.getFont("Segoe UI", 9, SWT.BOLD));
    lblStartTokens.setBounds(285, 142, 90, 15);
    lblStartTokens.setText("Start tokens");

    Label lblEndTokens = new Label(grpMorphologicalDescriptions, SWT.NONE);
    lblEndTokens.setFont(SWTResourceManager.getFont("Segoe UI", 9, SWT.BOLD));
    lblEndTokens.setBounds(443, 142, 68, 15);
    lblEndTokens.setText("End tokens");

    Label lblEmbeddedTokens = new Label(grpMorphologicalDescriptions, SWT.NONE);
    lblEmbeddedTokens.setFont(SWTResourceManager.getFont("Segoe UI", 9, SWT.BOLD));
    lblEmbeddedTokens.setBounds(592, 142, 132, 15);
    lblEmbeddedTokens.setText("Embedded tokens");

    descScrolledComposite =
        new ScrolledComposite(
            grpMorphologicalDescriptions, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
    descScrolledComposite.setBounds(10, 169, 714, 310);
    descScrolledComposite.setExpandHorizontal(true);
    descScrolledComposite.setExpandVertical(true);

    descriptionGroup = new Group(descScrolledComposite, SWT.NONE);
    descriptionGroup.setLayoutData(new RowData());

    text_33 = new Text(descriptionGroup, SWT.BORDER);
    text_33.setBounds(10, 20, 75, 20);

    Label lblNomenclature = new Label(descriptionGroup, SWT.NONE);
    lblNomenclature.setBounds(120, 20, 145, 20);
    lblNomenclature.setText("Nomenclature");

    text_40 = new Text(descriptionGroup, SWT.BORDER);
    text_40.setBounds(270, 20, 115, 20);

    text_41 = new Text(descriptionGroup, SWT.BORDER);
    text_41.setBounds(420, 20, 115, 20);

    text_42 = new Text(descriptionGroup, SWT.BORDER);
    text_42.setBounds(570, 20, 115, 20);

    sections.put(
        new Integer(secCount),
        new SectionBean(text_33, lblNomenclature, text_40, text_41, text_42));
    secCount++;

    String[] sectionArray = {
      "Morph. description", "Habitat", "Distribution", "Discussion", "Keys", "References"
    };
    for (String name : sectionArray) {
      addDescriptionRow(name);
    }

    descScrolledComposite.setContent(descriptionGroup);
    descScrolledComposite.setMinSize(descriptionGroup.computeSize(SWT.DEFAULT, SWT.DEFAULT));

    Button btnAddARow_1 = new Button(grpMorphologicalDescriptions, SWT.NONE);
    btnAddARow_1.setBounds(10, 482, 75, 25);
    btnAddARow_1.setText("Add a row");
    btnAddARow_1.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            identifier = null;
            showInputBox();
            if (identifier != null && !identifier.equals("")) {
              addDescriptionRow(identifier);
            }
          }
        });

    Label lblSectionIndicationsAnd = new Label(grpMorphologicalDescriptions, SWT.NONE);
    lblSectionIndicationsAnd.setFont(SWTResourceManager.getFont("Segoe UI", 9, SWT.BOLD));
    lblSectionIndicationsAnd.setBounds(10, 116, 222, 15);
    lblSectionIndicationsAnd.setText("Section indications and order:");

    TabItem tbtmSpecial = new TabItem(tabFolder, SWT.NONE);
    tbtmSpecial.setText("Special");

    Group grpSpecialSections = new Group(tabFolder, SWT.NONE);
    grpSpecialSections.setText("Special Sections");
    tbtmSpecial.setControl(grpSpecialSections);

    Label lblGlossaries = new Label(grpSpecialSections, SWT.NONE);
    lblGlossaries.setBounds(10, 51, 55, 15);
    lblGlossaries.setText("Glossaries:");

    Button btnHasGlossaries = new Button(grpSpecialSections, SWT.CHECK);
    btnHasGlossaries.setBounds(96, 51, 93, 16);
    btnHasGlossaries.setText("has glossaries");

    Label lblGlossaryHeading = new Label(grpSpecialSections, SWT.NONE);
    lblGlossaryHeading.setBounds(257, 51, 93, 15);
    lblGlossaryHeading.setText("Glossary heading");

    text_9 = new Text(grpSpecialSections, SWT.BORDER);
    text_9.setBounds(377, 48, 76, 21);

    Label lblReferences = new Label(grpSpecialSections, SWT.NONE);
    lblReferences.setBounds(10, 102, 69, 15);
    lblReferences.setText("References :");

    Button btnHasReferences = new Button(grpSpecialSections, SWT.CHECK);
    btnHasReferences.setBounds(96, 102, 93, 16);
    btnHasReferences.setText("has references");

    Label lblReferencesHeading = new Label(grpSpecialSections, SWT.NONE);
    lblReferencesHeading.setBounds(257, 102, 114, 15);
    lblReferencesHeading.setText("References heading:");

    text_10 = new Text(grpSpecialSections, SWT.BORDER);
    text_10.setBounds(377, 99, 76, 21);
    special = new SpecialBean(btnHasGlossaries, btnHasReferences, text_9, text_10);

    TabItem tbtmAbbreviations = new TabItem(tabFolder, SWT.NONE);
    tbtmAbbreviations.setText("Abbreviations");

    Group grpAbbreviationsUsedIn = new Group(tabFolder, SWT.NONE);
    tbtmAbbreviations.setControl(grpAbbreviationsUsedIn);

    text_11 = new Text(grpAbbreviationsUsedIn, SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
    text_11.setBounds(10, 52, 691, 69);
    abbreviations.put("Text", text_11);

    Label lblAbbreviationsUsedIn = new Label(grpAbbreviationsUsedIn, SWT.NONE);
    lblAbbreviationsUsedIn.setBounds(10, 31, 272, 15);
    lblAbbreviationsUsedIn.setText("Abbreviations used in text:");

    Label lblAbbreviationsUsedIn_1 = new Label(grpAbbreviationsUsedIn, SWT.NONE);
    lblAbbreviationsUsedIn_1.setBounds(10, 150, 272, 15);
    lblAbbreviationsUsedIn_1.setText("Abbreviations used in bibliographical citations:");

    text_12 = new Text(grpAbbreviationsUsedIn, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL | SWT.MULTI);
    text_12.setBounds(10, 175, 691, 69);
    abbreviations.put("Bibliographical Citations", text_12);

    Label lblAbbreviationsUsedIn_2 = new Label(grpAbbreviationsUsedIn, SWT.NONE);
    lblAbbreviationsUsedIn_2.setBounds(10, 275, 272, 15);
    lblAbbreviationsUsedIn_2.setText("Abbreviations used in authorities:");

    text_13 = new Text(grpAbbreviationsUsedIn, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL | SWT.MULTI);
    text_13.setBounds(10, 296, 691, 69);
    abbreviations.put("Authorities", text_13);

    Label lblAbbreviationsUsedIn_3 = new Label(grpAbbreviationsUsedIn, SWT.NONE);
    lblAbbreviationsUsedIn_3.setBounds(10, 395, 204, 15);
    lblAbbreviationsUsedIn_3.setText("Abbreviations used in others:");

    text_8 = new Text(grpAbbreviationsUsedIn, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL | SWT.MULTI);
    text_8.setBounds(10, 416, 691, 69);
    abbreviations.put("Others", text_8);
    final Type2Bean bean =
        new Type2Bean(
            textBean, nomenclatures, expressions, descriptionBean, special, abbreviations);
    Button btnSave = new Button(shlTypeDocument, SWT.NONE);
    btnSave.setBounds(670, 563, 75, 25);
    btnSave.setText("Save");
    btnSave.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            try {
              if (configDb.saveType2Details(bean)) {
                ApplicationUtilities.showPopUpWindow(
                    ApplicationUtilities.getProperty("popup.info.savetype3"),
                    ApplicationUtilities.getProperty("popup.header.info"),
                    SWT.ICON_INFORMATION);
                shlTypeDocument.dispose();
              }
            } catch (SQLException exe) {

            }
          }
        });

    /* Load previously saved details here */
    try {
      configDb.retrieveType2Details(bean, this);
    } catch (SQLException exe) {
      exe.printStackTrace();
    }

    shlTypeDocument.open();
    shlTypeDocument.layout();
    while (!shlTypeDocument.isDisposed()) {
      if (!display.readAndDispatch()) display.sleep();
    }
  }
Exemplo n.º 3
0
  /** *************************************************************** */
  private void creaContenidos() {
    display = new Display();
    shell = new Shell();

    // EN CASO DE NO RECUPERAR BIEN TOD0 EL CODIGO CNO browser.getText(); lo hacemos con el DOM
    // mediante JAVASCRIPT
    // System.out.println( (String)brw.evaluate("return document.forms[0].innerHTML;") );
    //
    // if ((Boolean)brw.evaluate("return raise('SelectFare', new SelectFareEventArgs(1, 1, 'G'));"))
    // System.out.println("raise() EJEC CORRECMT");;

    final String html =
        "<html><title>Snippet</title><body><p id='myid'>Best Friends</p><p id='myid2'>Cat and Dog</p></body></html>";
    // final String jsSelecValladolid = "var i=0; while(Stations[i]!=null){; i++;}";

    // Ej de jQuery que funciona: Devuelve el valor del listbox de "Origen Vuelo" selecionado
    final String jQueryRyan = "var orig=$(\"select[@id*='Origin1']\").val(); alert(orig);";
    // "$(\"select[@id*='Origin1']\")[posicion].attr('selected', 'true');";

    /** *** VARIABLES !!!VENTANA¡¡¡ **** */

    // SYSTEM TRAY
    Image image = null;
    try {
      // image = new Image(display, /*rutaActual*/"C:\\"+"fr.ico");
      image = new Image(display, rutaActual + "fr.ico");
    } catch (Exception e) {
      e.getMessage();
    }
    final Tray tray = display.getSystemTray();
    if (tray == null) {
      System.out.println("El system tray no está disponible");
    } else {
      final TrayItem item = new TrayItem(tray, SWT.NONE);
      item.setToolTipText("Ryanair Inspector v2");
      item.setImage(image);
      // Click simple en en icono
      item.addListener(
          SWT.Selection,
          new Listener() {
            public void handleEvent(Event event) {
              // System.out.println("selection");
            }
          });
      // Doble click en en icono
      item.addListener(
          SWT.DefaultSelection,
          new Listener() {
            public void handleEvent(Event event) {
              // System.out.println("default selection");
              // mio
              if (shell.getVisible()) shell.setVisible(false);
              else shell.setVisible(true);
              // shell.setMinimized(false);
              // shell.setMinimized(true);
            }
          });
    }

    // SHELL
    shell.setSize(1054, 727);
    // shell.setLayout(new FillLayout());
    shell.setText("Ryanair checker");
    shell.setImage(image);
    // Con esto al agrandar y empequeñecer se reorganizan los componentes
    // shell.setLayout(new FillLayout());

    // CREAMOS CONTENEDOR
    /** ************************************************************************ */
    compIzq = new Composite(shell, SWT.NONE);
    compIzq.setBounds(0, 0, 765, 691);
    final FillLayout fillLayout = new FillLayout(SWT.VERTICAL);
    fillLayout.marginWidth = 200;
    fillLayout.marginHeight = 200;
    // comp.setLayout(fillLayout);
    // comp.setSize(200, 200);

    compDer = new Composite(shell, SWT.NONE);
    compDer.setBounds(771, 0, 267, 691);

    // CREAMOS CAJA TEXTO Y BOTON PARA HTML OBTENIDO
    /** ************************************************************************ */
    final Text txtGetHTML = new Text(compDer, SWT.MULTI);
    txtGetHTML.setBounds(0, 0, 251, 198);

    // RyanairInspector2.class.getResource("RyanairInspector2.class").getPath();
    // System.getProperty("user.dir")+"\\bin\\calculadora\\";
    txtGetHTML.setText(
        RyanairInspector2.class.getResource("RyanairInspector2.class").getPath()
            + "\n"
            + System.getProperty("user.dir"));

    final Button button = new Button(compDer, SWT.NONE);
    button.setText("button");

    // TABS
    /** ************************************************************************ */
    tabFolder = new TabFolder(compIzq, SWT.BORDER);
    itemT1 = new TabItem(tabFolder, SWT.NONE);
    itemT2 = new TabItem(tabFolder, SWT.NONE);
    itemT3 = new TabItem(tabFolder, SWT.NONE);
    itemT1.setText("Resultado");
    itemT2.setText("Debugger");
    itemT3.setText("Hilos");

    // TABLE CON DOS COLUMNAS
    /** ************************************************************************ */
    table = new Table(tabFolder, SWT.VIRTUAL);
    table.setHeaderVisible(true);
    table.setLinesVisible(true);

    final TableColumn column1 = new TableColumn(table, SWT.NONE);
    column1.setText("Origen");
    column1.setWidth(200);
    final TableColumn column2 = new TableColumn(table, SWT.NONE);
    column2.setText("Destino");
    column2.setWidth(200);
    final TableColumn column3 = new TableColumn(table, SWT.NONE);
    column3.setText("Fecha");
    column3.setWidth(200);
    final TableColumn column4 = new TableColumn(table, SWT.NONE);
    column4.setText("Precio");
    column4.setWidth(150);

    /* Metemos elementos en la tabla
    TableItem fila = new TableItem(table, SWT.NONE);
    fila.setText(new String[] { "a", "b", "c", "d" });
    */

    // METEMOS EL TABLE EN LA TAB2
    itemT1.setControl(table);
    tabFolder.setBounds(0, 0, 700, 691);
    tabFolder.pack();

    // CREAMOS BROWSER
    /** ************************************************************************ */
    try {
    } catch (SWTError e) {
      System.out.println("Could not instantiate Browser: " + e.getMessage());
      return;
    }
    // CREAMOS BROWSER (2)
    /** ************************************************************************ */
    // FUNCIONA BIEN SIN TABS: browser = new Browser(compIzq, SWT.BORDER);

    // El Normal
    navegadores.add(new Navegador(tabFolder, SWT.BORDER));
    // El Mozilla (hay q ejecutar el xulrunner.exe --register-global)
    // browser = new Browser(tabFolder, SWT.MOZILLA);
    // browser.setSize(1000, 800);
    navegadores.get(0).setBounds(0, 0, 787, 691);
    // browser.setLocation(500, 900);
    /*final FillLayout fillLayoutB = new FillLayout(SWT.VERTICAL);
    fillLayoutB.marginWidth = 200;
    fillLayoutB.marginHeight = 200;
    browser.setLayout(fillLayoutB);
     */

    // METEMOS EL BROWSER EN LA TAB1
    itemT2.setControl(navegadores.get(0)); // prueba18-6-09
    // browser.setVisible(false);

    tabFolder.setBounds(0, 0, 766, 691);
    tabFolder.pack();

    navegadores.add(new Navegador(tabFolder, SWT.BORDER));
    navegadores.get(1).setBounds(0, 0, 787, 691);
    itemT3.setControl(navegadores.get(1));

    // CADA VEZ!!! QUE TERMINE DE CARGAR
    navegadores
        .get(0)
        .addProgressListener(
            new ProgressAdapter() {
              public void completed(ProgressEvent event) {
                if (!postSubmit(navegadores.get(0), table)) {
                  System.out.println(
                      "ERROR: Problema al ejecutar la gestion de los datos, finalizar la carga de la pagina.");
                }
              }
            });

    // CADA VEZ!!! QUE TERMINE DE CARGAR
    navegadores
        .get(1)
        .addProgressListener(
            new ProgressAdapter() {
              public void completed(ProgressEvent event) {
                if (!postSubmit(navegadores.get(1), table)) {
                  System.out.println(
                      "ERROR: Problema al ejecutar la gestion de los datos, finalizar la carga de la pagina.");
                }
              }
            });

    // BOTON OBTENER HTML
    /** ************************************************************************ */
    final Button btnGetHTML = new Button(compDer, SWT.PUSH);
    btnGetHTML.setBounds(0, 204, 151, 30);
    btnGetHTML.setText("Obtener codigo html");
    btnGetHTML.addListener(
        SWT.Selection,
        new Listener() {
          public void handleEvent(Event event) {

            addBrowser();

            String result = navegadores.get(0).getText();
            txtGetHTML.setText(result);
          }
        });

    // CREAMOS CAJA TEXTO PARA EJECUTAR JS
    /** ************************************************************************ */
    /*final Text txtJS = new Text(compDer, SWT.MULTI);
    txtJS.setText("var newNode = document.createElement('P'); \r\n"+
    		"var text = document.createTextNode('At least when I am around');\r\n"+
    		"newNode.appendChild(text);\r\n"+
    		"document.getElementById('myid').appendChild(newNode);\r\n"+
    		"document.bgColor='yellow';\r\n"+
    		"\r\n"+
    		"document.getElementById('AvailabilitySearchInputFRSearchView_OneWay').checked = true;\r\n"+
    		"document.getElementById('AvailabilitySearchInputFRSearchView_ButtonSubmit').click();\r\n"+
    		"document.getElementById('AvailabilitySearchInputFRSearchView_DropDownListMarketOrigin1')[2].selected=true;\r\n"+
    		"Destination1");
    */

    // BOTON LANZAMOS RYANAIR
    /** ************************************************************************ */
    /*final Button btnCargarRyan = new Button(compDer, SWT.PUSH);
    btnCargarRyan.setText("Cargar RYANAIR");
    btnCargarRyan.addListener(SWT.Selection, new Listener() {
    	public void handleEvent(Event event) {
    		//boolean result = browser.execute(text.getText());
    		boolean result = browser.setUrl("http://www.bookryanair.com/SkySales/FRSearch.aspx?culture=ES-ES&pos=HEAD");
    		if (!result) {
    			// Script may fail or may not be supported on certain platforms.
    			System.out.println("Script was not executed.");
    		}
    	}
    });
    */

    // BOTON EJECUTAMOS JAVASCRIPT
    /** ************************************************************************ */
    final Button btnEjeJS = new Button(compDer, SWT.PUSH);
    btnEjeJS.setBounds(0, 266, 151, 30);
    btnEjeJS.setText("Ejecutar JAVASCRIPT");
    btnEjeJS.addListener(
        SWT.Selection,
        new Listener() {
          public void handleEvent(Event event) {}
        });

    // image.dispose(); //con esto no funciona el shell.setImage(image)

  }
  /** Create contents of the window */
  protected void createContents() {

    m_shell = new Shell();

    m_shell.setImage(SWTResourceManager.getImage(IPAToolAppWnd.class, "/Properties.ico"));
    final BorderLayout borderLayout = new BorderLayout(0, 0);
    borderLayout.setVgap(5);
    m_shell.setLayout(borderLayout);
    m_shell.setSize(800, 400);
    m_shell.setMinimumSize(new Point(800, 400));
    m_shell.setText("IPATool2");

    Composite composite;
    composite = new Composite(m_shell, SWT.NONE);
    {
      TabFolder tabFolder = new TabFolder(composite, SWT.NONE);
      tabFolder.setBounds(10, 10, 748, 200);

      {
        TabItem tbtmTools = new TabItem(tabFolder, SWT.NONE);
        tbtmTools.setText("Tools");

        Composite composite_1 = new Composite(tabFolder, SWT.NONE);
        tbtmTools.setControl(composite_1);

        m_txtUpdFolder = new Text(composite_1, SWT.BORDER);
        m_txtUpdFolder.setText("");
        m_txtUpdFolder.setBounds(122, 14, 564, 21);

        Button btnUpdFolder = new Button(composite_1, SWT.NONE);
        btnUpdFolder.addSelectionListener(
            new SelectionAdapter() {

              @Override
              public void widgetSelected(SelectionEvent e) {
                _selectFolder(m_txtUpdFolder);
              }
            });
        btnUpdFolder.setText("...");
        btnUpdFolder.setBounds(692, 12, 38, 25);

        m_txtExistingFolder = new Text(composite_1, SWT.BORDER);
        m_txtExistingFolder.setText("");
        m_txtExistingFolder.setBounds(122, 45, 564, 21);

        Button btnExFolder = new Button(composite_1, SWT.NONE);
        btnExFolder.addSelectionListener(
            new SelectionAdapter() {

              @Override
              public void widgetSelected(SelectionEvent e) {
                _selectFolder(m_txtExistingFolder);
              }
            });
        btnExFolder.setText("...");
        btnExFolder.setBounds(692, 43, 38, 25);

        m_txtITunesFolder = new Text(composite_1, SWT.BORDER);
        m_txtITunesFolder.setText("");
        m_txtITunesFolder.setBounds(122, 76, 564, 21);

        Button btnitunesFolder = new Button(composite_1, SWT.NONE);
        btnitunesFolder.addSelectionListener(
            new SelectionAdapter() {

              @Override
              public void widgetSelected(SelectionEvent e) {
                _selectFolder(m_txtITunesFolder);
              }
            });
        btnitunesFolder.setText("...");
        btnitunesFolder.setBounds(692, 74, 38, 25);

        m_lbliTunes = new Label(composite_1, SWT.NONE);
        m_lbliTunes.setText("iTunes IPAs Folder:");
        m_lbliTunes.setBounds(10, 79, 119, 15);

        m_lblExFolder = new Label(composite_1, SWT.NONE);
        m_lblExFolder.setText("Current IPAs Folder:");
        m_lblExFolder.setBounds(10, 48, 119, 15);

        Label lblUpdFolder = new Label(composite_1, SWT.NONE);
        lblUpdFolder.setFont(SWTResourceManager.getFont("Segoe UI", 9, SWT.BOLD));
        lblUpdFolder.setForeground(SWTResourceManager.getColor(SWT.COLOR_RED));
        lblUpdFolder.setText(" IPAs Folder:");
        lblUpdFolder.setBounds(10, 17, 119, 15);
        {
          m_chkRecurseFolders = new Button(composite_1, SWT.CHECK);
          m_chkRecurseFolders.addSelectionListener(
              new SelectionAdapter() {

                @Override
                public void widgetSelected(SelectionEvent e) {}
              });
          m_chkRecurseFolders.setLocation(122, 103);
          m_chkRecurseFolders.setSize(107, 16);
          m_chkRecurseFolders.setSelection(true);
          m_chkRecurseFolders.setText("Recurse folders");
        }
        {
          m_btnRenameIPAs = new Button(composite_1, SWT.NONE);
          m_btnRenameIPAs.setBackground(SWTResourceManager.getColor(SWT.COLOR_RED));
          m_btnRenameIPAs.setLocation(120, 137);
          m_btnRenameIPAs.setSize(94, 25);
          m_btnRenameIPAs.addSelectionListener(
              new SelectionAdapter() {

                @Override
                public void widgetSelected(SelectionEvent e) {
                  renameIPAs();
                }
              });
          m_btnRenameIPAs.setText("Rename IPAs");
        }

        m_btnUpdateIPAs = new Button(composite_1, SWT.NONE);
        m_btnUpdateIPAs.addSelectionListener(
            new SelectionAdapter() {

              @Override
              public void widgetSelected(SelectionEvent e) {
                updateIPAs();
              }
            });
        m_btnUpdateIPAs.setBounds(216, 137, 94, 25);
        m_btnUpdateIPAs.setText("Update IPAs");

        m_chkUseAllFolders = new Button(composite_1, SWT.CHECK);
        m_chkUseAllFolders.addSelectionListener(
            new SelectionAdapter() {

              @Override
              public void widgetSelected(SelectionEvent e) {
                if (m_chkUseAllFolders.getSelection()) {
                  m_lblExFolder.setForeground(SWTResourceManager.getColor(SWT.COLOR_RED));
                  m_lbliTunes.setForeground(SWTResourceManager.getColor(SWT.COLOR_RED));
                } else {
                  m_lblExFolder.setForeground(null);
                  m_lbliTunes.setForeground(null);
                }
              }
            });
        m_chkUseAllFolders.setBounds(244, 103, 107, 16);
        m_chkUseAllFolders.setText("Use all folders");

        m_btnCleanJPGs = new Button(composite_1, SWT.NONE);
        m_btnCleanJPGs.setBackground(SWTResourceManager.getColor(SWT.COLOR_RED));
        m_btnCleanJPGs.setBounds(310, 137, 94, 25);
        m_btnCleanJPGs.addSelectionListener(
            new SelectionAdapter() {

              @Override
              public void widgetSelected(SelectionEvent e) {
                cleanJPEGs();
              }
            });
        m_btnCleanJPGs.setText("Clean JPEGs");
      }

      TabItem tbtmCheckIPAs = new TabItem(tabFolder, SWT.NONE);
      tbtmCheckIPAs.setText("Check");

      Composite composite_1 = new Composite(tabFolder, SWT.NONE);
      tbtmCheckIPAs.setControl(composite_1);

      m_txtIPhoneFolder = new Text(composite_1, SWT.BORDER);
      m_txtIPhoneFolder.setText("");
      m_txtIPhoneFolder.setBounds(122, 14, 564, 21);

      Button btnIPhoneFolder = new Button(composite_1, SWT.NONE);
      btnIPhoneFolder.addSelectionListener(
          new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
              _selectFolder(m_txtIPhoneFolder);
            }
          });
      btnIPhoneFolder.setText("...");
      btnIPhoneFolder.setBounds(692, 12, 38, 25);

      m_txtIPadFolder = new Text(composite_1, SWT.BORDER);
      m_txtIPadFolder.setText("");
      m_txtIPadFolder.setBounds(122, 45, 564, 21);

      Button btnIPadFolder = new Button(composite_1, SWT.NONE);
      btnIPadFolder.addSelectionListener(
          new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
              _selectFolder(m_txtIPadFolder);
            }
          });
      btnIPadFolder.setText("...");
      btnIPadFolder.setBounds(692, 43, 38, 25);

      m_txtMixedFolder = new Text(composite_1, SWT.BORDER);
      m_txtMixedFolder.setText("");
      m_txtMixedFolder.setBounds(122, 76, 564, 21);

      Button btnMixedFolder = new Button(composite_1, SWT.NONE);
      btnMixedFolder.addSelectionListener(
          new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
              _selectFolder(m_txtMixedFolder);
            }
          });
      btnMixedFolder.setText("...");
      btnMixedFolder.setBounds(692, 74, 38, 25);

      Label lblBothIpasFolder = new Label(composite_1, SWT.NONE);
      lblBothIpasFolder.setText("mixed Folder:");
      lblBothIpasFolder.setBounds(10, 79, 119, 15);

      Label lblIpadIpasFolder = new Label(composite_1, SWT.NONE);
      lblIpadIpasFolder.setText("iPad Folder:");
      lblIpadIpasFolder.setBounds(10, 48, 119, 15);

      Label lblIphoneFolder = new Label(composite_1, SWT.NONE);
      lblIphoneFolder.setText("iPhone Folder:");
      lblIphoneFolder.setBounds(10, 17, 119, 15);

      m_btnCheck = new Button(composite_1, SWT.NONE);
      m_btnCheck.addSelectionListener(
          new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
              checkIPAs();
            }
          });
      m_btnCheck.setText("Check IPAs");
      m_btnCheck.setBounds(122, 122, 90, 25);
    }
    composite.setLayoutData(BorderLayout.NORTH);

    final Label lblX = new Label(composite, SWT.NONE);
    lblX.setBounds(10, 10, 14, 211);
    final TabFolder m_tabTraces = new TabFolder(m_shell, SWT.NONE);
    m_tabTraces.setLayoutData(BorderLayout.CENTER);

    final Composite composite_1 = new Composite(m_shell, SWT.NONE);
    composite_1.setLayout(new BorderLayout(0, 0));
    composite_1.setLayoutData(BorderLayout.CENTER);

    // ------------------------------------------------------------------------
    // ********** TabbedTracer ***********************************************
    final CTabFolder tabTraces = m_tabbedTracer.createTabFolder(composite_1);
    tabTraces.setLayoutData(BorderLayout.CENTER);
    Tracer.setTracer(m_tabbedTracer);
  }
  /** Create contents of the window */
  protected void createContents() {

    m_BkscoverageShell = new Shell();

    m_BkscoverageShell.setImage(
        SWTResourceManager.getImage(BKSCoverageAppWnd.class, "/Properties.ico"));
    final BorderLayout borderLayout = new BorderLayout(0, 0);
    borderLayout.setVgap(5);
    m_BkscoverageShell.setLayout(borderLayout);
    m_BkscoverageShell.setSize(800, 400);
    m_BkscoverageShell.setMinimumSize(new Point(800, 400));
    m_BkscoverageShell.setText("BKSCoverage");

    Composite composite;
    composite = new Composite(m_BkscoverageShell, SWT.NONE);
    {
      TabFolder tabFolder = new TabFolder(composite, SWT.NONE);
      tabFolder.setBounds(10, 10, 748, 173);

      {
        TabItem tbtmTools = new TabItem(tabFolder, SWT.NONE);
        tbtmTools.setText("Parameters");

        Composite composite_1 = new Composite(tabFolder, SWT.NONE);
        tbtmTools.setControl(composite_1);

        m_txtWKSPFolder = new Text(composite_1, SWT.BORDER);
        m_txtWKSPFolder.setText("");
        m_txtWKSPFolder.setBounds(122, 14, 564, 21);

        Button btnWKSPFolder = new Button(composite_1, SWT.NONE);
        btnWKSPFolder.addSelectionListener(
            new SelectionAdapter() {

              @Override
              public void widgetSelected(SelectionEvent e) {
                _selectFolder(m_txtWKSPFolder);
              }
            });
        btnWKSPFolder.setText("...");
        btnWKSPFolder.setBounds(692, 12, 38, 25);

        m_txtStorageFile = new Text(composite_1, SWT.BORDER);
        m_txtStorageFile.setText("");
        m_txtStorageFile.setBounds(122, 45, 564, 21);

        Button btnStorageFile = new Button(composite_1, SWT.NONE);
        btnStorageFile.addSelectionListener(
            new SelectionAdapter() {

              @Override
              public void widgetSelected(SelectionEvent e) {
                _selectFolder(m_txtStorageFile);
              }
            });
        btnStorageFile.setText("...");
        btnStorageFile.setBounds(692, 43, 38, 25);

        m_lblStorageFile = new Label(composite_1, SWT.NONE);
        m_lblStorageFile.setText("Storage File:");
        m_lblStorageFile.setBounds(10, 48, 119, 15);

        Label lblUpdFolder = new Label(composite_1, SWT.NONE);
        lblUpdFolder.setText("WKSP Folder:");
        lblUpdFolder.setBounds(10, 17, 119, 15);
        {
          m_chkLoadFromStorage = new Button(composite_1, SWT.CHECK);
          m_chkLoadFromStorage.addSelectionListener(
              new SelectionAdapter() {

                @Override
                public void widgetSelected(SelectionEvent e) {}
              });
          m_chkLoadFromStorage.setLocation(122, 75);
          m_chkLoadFromStorage.setSize(138, 16);
          m_chkLoadFromStorage.setSelection(true);
          m_chkLoadFromStorage.setText("Load From Storage");
        }
        {
          m_btnCheckWKSP = new Button(composite_1, SWT.NONE);
          m_btnCheckWKSP.setLocation(120, 109);
          m_btnCheckWKSP.setSize(90, 25);
          m_btnCheckWKSP.addSelectionListener(
              new SelectionAdapter() {

                @Override
                public void widgetSelected(SelectionEvent e) {
                  checkWKPS();
                }
              });
          m_btnCheckWKSP.setText("Check WKSP");
        }
      }
    }
    composite.setLayoutData(BorderLayout.NORTH);

    final Label lblX = new Label(composite, SWT.NONE);
    lblX.setBounds(10, 10, 14, 180);
    final CTabFolder m_tabTraces = new CTabFolder(m_BkscoverageShell, SWT.NONE);
    m_tabTraces.setLayoutData(BorderLayout.CENTER);

    m_infoTabItem = new CTabItem(m_tabTraces, SWT.NONE);
    m_infoTabItem.setText("Info");

    final Text txtInfo =
        new Text(m_tabTraces, SWT.V_SCROLL | SWT.READ_ONLY | SWT.MULTI | SWT.H_SCROLL | SWT.BORDER);
    txtInfo.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_BLACK));
    txtInfo.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
    txtInfo.setEditable(false);
    m_infoTabItem.setControl(txtInfo);

    m_warnTabItem = new CTabItem(m_tabTraces, SWT.NONE);
    m_warnTabItem.setText("Warning");

    final Text txtWarn =
        new Text(m_tabTraces, SWT.V_SCROLL | SWT.READ_ONLY | SWT.MULTI | SWT.H_SCROLL | SWT.BORDER);
    txtWarn.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_BLACK));
    txtWarn.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
    txtWarn.setEditable(false);
    m_warnTabItem.setControl(txtWarn);

    m_debugTabItem = new CTabItem(m_tabTraces, SWT.NONE);
    m_debugTabItem.setText("Debug");

    final Text txtDebug =
        new Text(m_tabTraces, SWT.V_SCROLL | SWT.READ_ONLY | SWT.MULTI | SWT.H_SCROLL | SWT.BORDER);
    txtDebug.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_BLACK));
    txtDebug.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
    txtDebug.setEditable(false);
    m_debugTabItem.setControl(txtDebug);

    m_errorTabItem = new CTabItem(m_tabTraces, SWT.NONE);
    m_errorTabItem.setText("Error");

    final Text txtError =
        new Text(m_tabTraces, SWT.V_SCROLL | SWT.READ_ONLY | SWT.MULTI | SWT.H_SCROLL | SWT.BORDER);
    txtError.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
    txtError.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
    txtError.setEditable(false);
    m_errorTabItem.setControl(txtError);
  }
 /* (non-Javadoc)
  * @see org.eclipse.ui.internal.skins.Presentation#setBounds(org.eclipse.swt.graphics.Rectangle)
  */
 public void setBounds(Rectangle bounds) {
   tabFolder.setBounds(bounds);
   setControlSize();
 }