📄 bsplugin.java
字号:
package edu.ou.kmi.buddyspace.plugins;
/*
* BSPlugin.java
*
* Project: BuddySpace
* (C) Copyright Knowledge Media Institute 2002
*
*
* Created on 26 September 2002, 9:05
*/
import javax.swing.*;
import java.util.*;
import org.jabber.jabberbeans.util.*;
import edu.ou.kmi.buddyspace.core.*;
import edu.ou.kmi.buddyspace.gui.*;
/**
* <code>BSPlugin</code> is abstract class for general BuddySpace plugin.
* It provides basic plugin functionality and interface for plug-in loader
* calls.
*
* @author Jiri Komzak, Knowledge Media Institute, Open University, United Kingdom
*/
public abstract class BSPlugin {
protected BSMainFrame mainFrame;
protected JTabbedPane tabbedPane;
protected BSCore core;
protected String name;
/** Constructor */
public BSPlugin(BSMainFrame mainFrame, JTabbedPane tabbedPane, BSCore core) {
this.mainFrame = mainFrame;
this.tabbedPane = tabbedPane;
this.core = core;
loadPreferences();
initCore();
initGUI();
addGUIControls();
connectBeans();
}
/** Handles connection change to connected */
public void connected() {
// updates beans
connectBeans();
}
/** Handles connection change to disconnected */
abstract public void disconnected();
/** Inits plugin core */
abstract protected void initCore();
/** Inits plugin GUI */
abstract protected void initGUI();
/** Adds controls to main window,... */
abstract protected void addGUIControls();
/** Connects to the BuddySpace beans */
abstract protected void connectBeans();
/** Loads preferences */
abstract protected void loadPreferences();
/** Adds components and their names for display in preferences dialog */
abstract public void getPreferencesTab(Vector components, Vector names);
/** Stores preferences from preferences tab */
abstract public boolean storePreferences();
/** Updates LAF of all plug-ins */
abstract public void updateLAF();
/**
* Performs action within given namespace for given JID.
* Returns if action was performed.
*/
public boolean performAction(JID jid, String namespace) {
return false;
}
/** Adds supported namespaces and their names */
abstract public void getSupportedNamespaces(Vector namespaces, Vector names);
/** Returns if there are some new messages (alerts) */
public boolean isNewMessage() {
return false;
}
/** Starts corba server for plugin. Returns if successful. */
public boolean startCorbaServer(String namespace) {
return true;
}
/** Shuts down corba server for plugin. */
public void shutdownCorbaServer(String namespace) { }
/** Opens windows specified in vector. */
public void openTheWindows(Vector openWindows, boolean connected) { }
/** Add its open windows into the vector (for opening when starting next time). */
public void addOpenWindows(Vector openWindows, boolean connected) { }
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -