SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru
    Join Date
    Sep 2008
    Location
    Dubai
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    is this java code?

    Hi,

    I am all new i java and web development, I find this code on google web tool kit
    . I like it and i want to apply it for my website.

    But i know nothing about java, I am using dreamweaver to design and code with php. How can I put the code in my workflow and make sure they work with html and php

    the code is below

    Code Java:
    /**
       * The constants used in this Content Widget.
       */
      public static interface CwConstants extends Constants,
          ContentWidget.CwConstants {
        String cwDisclosurePanelDescription();
     
        String cwDisclosurePanelFormAdvancedCriteria();
     
        String cwDisclosurePanelFormDescription();
     
        String cwDisclosurePanelFormGender();
     
        String[] cwDisclosurePanelFormGenderOptions();
     
        String cwDisclosurePanelFormLocation();
     
        String cwDisclosurePanelFormName();
     
        String cwDisclosurePanelFormTitle();
     
        String cwDisclosurePanelName();
      }
     
      /**
       * An instance of the constants.
       */
      private CwConstants constants;
     
      /**
       * Initialize this example.
       */
      @Override
      public Widget onInitialize() {
        // Add the disclosure panels to a panel
        VerticalPanel vPanel = new VerticalPanel();
        vPanel.setSpacing(8);
        vPanel.add(createAdvancedForm());
     
        // Return the panel
        return vPanel;
      }
     
      /**
       * Create a form that contains undisclosed advanced options.
       */
      private Widget createAdvancedForm() {
        // Create a table to layout the form options
        FlexTable layout = new FlexTable();
        layout.setCellSpacing(6);
        layout.setWidth("300px");
        FlexCellFormatter cellFormatter = layout.getFlexCellFormatter();
     
        // Add a title to the form
        layout.setHTML(0, 0, constants.cwDisclosurePanelFormTitle());
        cellFormatter.setColSpan(0, 0, 2);
        cellFormatter.setHorizontalAlignment(0, 0,
            HasHorizontalAlignment.ALIGN_CENTER);
     
        // Add some standard form options
        layout.setHTML(1, 0, constants.cwDisclosurePanelFormName());
        layout.setWidget(1, 1, new TextBox());
        layout.setHTML(2, 0, constants.cwDisclosurePanelFormDescription());
        layout.setWidget(2, 1, new TextBox());
     
        // Create some advanced options
        HorizontalPanel genderPanel = new HorizontalPanel();
        String[] genderOptions = constants.cwDisclosurePanelFormGenderOptions();
        for (int i = 0; i < genderOptions.length; i++) {
          genderPanel.add(new RadioButton("gender", genderOptions[i]));
        }
        Grid advancedOptions = new Grid(2, 2);
        advancedOptions.setCellSpacing(6);
        advancedOptions.setHTML(0, 0, constants.cwDisclosurePanelFormLocation());
        advancedOptions.setWidget(0, 1, new TextBox());
        advancedOptions.setHTML(1, 0, constants.cwDisclosurePanelFormGender());
        advancedOptions.setWidget(1, 1, genderPanel);
     
        // Add advanced options to form in a disclosure panel
        DisclosurePanel advancedDisclosure = new DisclosurePanel(
            constants.cwDisclosurePanelFormAdvancedCriteria());
        advancedDisclosure.setAnimationEnabled(true);
        advancedDisclosure.ensureDebugId("cwDisclosurePanel");
        advancedDisclosure.setContent(advancedOptions);
        layout.setWidget(3, 0, advancedDisclosure);
        cellFormatter.setColSpan(3, 0, 2);
     
        // Wrap the contents in a DecoratorPanel
        DecoratorPanel decPanel = new DecoratorPanel();
        decPanel.setWidget(layout);
        return decPanel;
      }

  2. #2
    SitePoint Wizard rozner's Avatar
    Join Date
    Oct 2002
    Location
    Paris
    Posts
    1,058
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well I suppose you could just copy and paste this into a PHP file and see what happens...

  3. #3
    SitePoint Guru
    Join Date
    Sep 2008
    Location
    Dubai
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would do that if i know how it is integrated properly.

  4. #4
    SitePoint Zealot
    Join Date
    Sep 2008
    Posts
    199
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You have to install GWT to compile it.
    You can't just compile that file.
    You have to create Application then Module
    http://code.google.com/webtoolkit/gettingstarted.html

    GWT is not Java. GWT is based on Java.
    If you learn Java then leave GWT for some time.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •