src.com.ibm.as400.access.PanelGroup Maven / Gradle / Ivy
Show all versions of jt400-jdk8 Show documentation
///////////////////////////////////////////////////////////////////////////////
//
// JTOpen (IBM Toolbox for Java - OSS version)
//
// Filename: PanelGroup.java
//
// The source code contained herein is licensed under the IBM Public License
// Version 1.0, which has been approved by the Open Source Initiative.
// Copyright (C) 1997-2002 International Business Machines Corporation and
// others. All rights reserved.
//
///////////////////////////////////////////////////////////////////////////////
package com.ibm.as400.access;
import java.io.*;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
/**
* Represents an IBM i panel group (*PNLGRP) object.
* The help text for a given panel group and set of keywords can be retrieved
* using the {@link #getHelpText getHelpText} method.
*
* To generate HTML documentation from the panel groups of a given CL command,
* see the {@link com.ibm.as400.util.CommandHelpRetriever CommandHelpRetriever} utility.
**/
public class PanelGroup implements Serializable
{
/**
* This class uses the QUHRHLPT system API to retrieve the help text.
**/
static final long serialVersionUID = 6L;
private AS400 system_;
private String path_;
// List of property change event bean listeners.
private transient PropertyChangeSupport propertyChangeListeners_ = new PropertyChangeSupport(this);
/**
* Constructs a PanelGroup object.
**/
public PanelGroup()
{
initializeTransient();
}
/**
* Constructs a PanelGroup object.
* @param system The system on which the panel group resides.
* @param path The fully integrated file system path name of the panel group.
* @see com.ibm.as400.access.QSYSObjectPathName
**/
public PanelGroup(AS400 system, String path)
{
if (system == null)
throw new NullPointerException("system");
if (path == null)
throw new NullPointerException("path");
QSYSObjectPathName.validatePath(path, "PNLGRP");
system_ = system;
path_ = path;
initializeTransient();
}
/**
* Adds a PropertyChangeListener. The specified PropertyChangeListener's propertyChange method will be called each time the value of any bound property is changed.
* The PropertyChangeListener object is added to a list of PropertyChangeListeners managed by this PanelGroup. It can be removed with removePropertyChangeListener.
*
* @param listener The PropertyChangeListener.
**/
public void addPropertyChangeListener(PropertyChangeListener listener)
{
if (listener == null)
{
throw new NullPointerException("listener");
}
propertyChangeListeners_.addPropertyChangeListener(listener);
}
/**
* Returns the panel group help identifiers for the specified keywords.
* @param keywords An array of keywords for which to retrieve help. The panel group to which
* the keywords belong is assumed to be the path of this PanelGroup object.
* @return The help identifiers.
* @throws AS400Exception If an error occurs.
* @throws AS400SecurityException If a security or authority error occurs.
* @throws ErrorCompletingRequestException If an error occurs before the request is completed.
* @throws IOException If an error occurs while communicating with the system.
* @throws InterruptedException If this thread is interrupted.
* @throws ObjectDoesNotExistException If the object does not exist.
**/
public synchronized PanelGroupHelpIdentifier[] getHelpIdentifiers(String[] keywords) throws AS400Exception, AS400SecurityException,
ErrorCompletingRequestException, IOException,
InterruptedException, ObjectDoesNotExistException
{
if (keywords == null) throw new NullPointerException("keywords");
if (system_ == null) throw new ExtendedIllegalStateException("system", ExtendedIllegalStateException.PROPERTY_NOT_SET);
if (path_ == null) throw new ExtendedIllegalStateException("path", ExtendedIllegalStateException.PROPERTY_NOT_SET);
if (Trace.traceOn_)
{
Trace.log(Trace.DIAGNOSTIC, "Retrieving help identifiers for "+keywords.length+" keywords: ");
for (int i=0; i