com.jaspersoft.studio.server.properties.DatasourceJNDISection.java Source code

Java tutorial

Introduction

Here is the source code for com.jaspersoft.studio.server.properties.DatasourceJNDISection.java

Source

/*******************************************************************************
 * Copyright (C) 2005 - 2014 TIBCO Software Inc. All rights reserved.
 * http://www.jaspersoft.com.
 * 
 * Unless you have purchased  a commercial license agreement from Jaspersoft,
 * the following license terms  apply:
 * 
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 ******************************************************************************/
package com.jaspersoft.studio.server.properties;

import org.eclipse.core.databinding.beans.PojoObservables;
import org.eclipse.jface.databinding.swt.SWTObservables;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;

import com.jaspersoft.studio.properties.view.TabbedPropertySheetPage;
import com.jaspersoft.studio.property.section.AbstractSection;

public class DatasourceJNDISection extends ASection {
    private Text tname;

    public DatasourceJNDISection() {
        super();
    }

    @Override
    protected void createSectionControls(Composite parent, TabbedPropertySheetPage aTabbedPropertySheetPage) {
        AbstractSection.createLabel(parent, getWidgetFactory(), "JNDI Name", 120);

        tname = getWidgetFactory().createText(parent, "", SWT.BORDER);
        tname.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    }

    @Override
    public void enableFields(boolean enable) {
        tname.setEditable(enable);
    }

    @Override
    protected void bind() {
        bindingContext.bindValue(SWTObservables.observeText(tname, SWT.Modify),
                PojoObservables.observeValue(res.getValue(), "jndiName"));
    }

}