private void makeEditable(boolean editable) {
   if (editable) {
     editorPanel.setStylePrimaryName(style.editorPanelVisible());
     viewPanel.setStylePrimaryName(style.viewPanelHidden());
     clickToEdit.setText("Done");
   } else {
     editorPanel.setStylePrimaryName(style.editorPanelHidden());
     viewPanel.setStylePrimaryName(style.viewPanelVisible());
     clickToEdit.setText("Edit");
   }
 }
Esempio n. 2
0
 @Override
 public void showSection(UIObject display, String section, String sub_section) {
   String sectionToSelect = section;
   if (sub_section != "") sectionToSelect = sectionToSelect + "_" + sub_section;
   setSelectedItem(sectionToSelect, null);
   tree.ensureSelectedItemVisible();
   if (!section.equals(currentSection)) {
     HTMLPanel container = new HTMLPanel("");
     container.setStylePrimaryName(resources.style().help_container());
     container.getElement().appendChild(display.getElement());
     contentContainer.setWidget(container);
     currentSection = section;
     currentSubSection = sub_section;
   } else {
     currentSubSection = sub_section;
   }
   if (!currentSubSection.equals("")) {
     Element elem = DOM.getElementById(currentSection + "_" + currentSubSection);
     if (elem != null) {
       elem.scrollIntoView();
     }
   } else contentContainer.getWidget().getElement().setScrollTop(0);
 }