/* * (non-Javadoc) * * @see com.ibm.commons.swt.data.layouts.BasicsPanel#createPostSection() */ @Override protected void createPostSection() { Label l = createLabel( "At runtime, open selected document using:", null); // $NLX-DataViewBasicsPanel.Atruntimeopenselecteddocumentusin-1$ GridData data = SWTLayoutUtils.createGDFillHorizontalNoGrab(); data.horizontalSpan = 2; l.setLayoutData(data); if (hasPageName()) { DesignerDELookup designElementLookup = new DesignerDELookup( getExtraData().getDesignerProject(), DesignerResource.TYPE_XPAGE, false); createComboComputed( IExtLibAttrNames.EXT_LIB_ATTR_PAGE_NAME, designElementLookup, GridDataFactory.copyData(data), true, true, "pageName.combo.id", "XPage associated with the document's form"); // $NON-NLS-1$ // $NLX-DataViewBasicsPanel.XPageassociatedwiththedocumentsfo-3$ // $NLX-DataViewBasicsPanel.XPageassociatedwiththedocumentsfo-2$ } if (hasTarget()) { // we want to change the tooltip as the user changes the value of the combo as some of the // text is truncated in the combo final HashMap<String, String> winBehaveTooltipMap = new HashMap<String, String>(); String LABEL_COMBOBOX_DEFAULT = "Use page default"; // $NLX-DataViewBasicsPanel.Usepagedefault-1$ String LABEL_COMBOBOX_NEW_WIN = "Open new window or tab (per client preference)"; // $NLX-DataViewBasicsPanel.Opennewwindowortabperclientprefer-1$ String LABEL_COMBOBOX_SAME_WIN = "Open in same window and tab"; // $NLX-DataViewBasicsPanel.Openinsamewindowandtab-1$ String[] ATTRIB_LABELS = {LABEL_COMBOBOX_SAME_WIN, LABEL_COMBOBOX_NEW_WIN}; String[] ATTRIB_VALS = { XSPAttributeNames.XSP_ATTR_VAL_SELF, XSPAttributeNames.XSP_ATTR_VAL_BLANK }; winBehaveTooltipMap.put("", LABEL_COMBOBOX_DEFAULT); winBehaveTooltipMap.put(XSPAttributeNames.XSP_ATTR_VAL_SELF, LABEL_COMBOBOX_SAME_WIN); winBehaveTooltipMap.put(XSPAttributeNames.XSP_ATTR_VAL_BLANK, LABEL_COMBOBOX_NEW_WIN); GridData gd = SWTLayoutUtils.createGDFillHorizontal(); gd.horizontalSpan = 2; createLabel( "Window behavior for navigation and links (Notes client only):", gd, getLabelToolTipText( XSPAttributeNames .XSP_ATTR_TARGET)); // $NLX-DataViewBasicsPanel.Windowbehaviorfornavigationandlin-1$ final DCCompositeCombo combo = createComboComputed( XSPAttributeNames.XSP_ATTR_TARGET, new StringLookup(ATTRIB_VALS, ATTRIB_LABELS), GridDataFactory.copyData(gd), true, true); combo.setFirstLineTitle(LABEL_COMBOBOX_DEFAULT); String tip = winBehaveTooltipMap.get(""); if (StringUtil.isNotEmpty(combo.getValue())) { tip = winBehaveTooltipMap.get(combo.getValue()); } combo.getEditorControl().setToolTipText(tip); combo.addValueChangedListener( new ValueChangedListener() { public void valueChanged(ValueChangedEvent event) { // update the tooltip based on the current value combo.getEditorControl().setToolTipText(winBehaveTooltipMap.get(combo.getValue())); } }); } }