renamed show method to avoid overriding

cusax-fix
Emil Ivov 20 years ago
parent b89faa023e
commit 71cb466db5

@ -19,74 +19,74 @@
public class Activator implements BundleActivator
{
{
private Logger logger = Logger.getLogger(Activator.class.getName());
private UIService uiService = null;
private AccountManager icqAccountManager = null;
private CommunicatorMain communicatorMain = new CommunicatorMain();
private LoginWindow loginWindow = new LoginWindow();
private AccountID icqAccountID;
public void start(BundleContext bundleContext) throws Exception
public void start(BundleContext bundleContext) throws Exception
{
try
{
logger.logEntry();
logger.logEntry();
//Create the ui service
this.uiService =
new UIServiceImpl();
//ServiceReference clistReference
//= bundleContext.getServiceReference(MetaContactListService.class.getName());
//MetaContactListService contactListService
//= (MetaContactListService)bundleContext.getService(clistReference);
ServiceReference[] serRefs = null;
String osgiFilter = "(" + AccountManager.PROTOCOL_PROPERTY_NAME
+ "="+ProtocolNames.ICQ+")";
serRefs = bundleContext.getServiceReferences(
AccountManager.class.getName(), osgiFilter);
icqAccountManager = (AccountManager)bundleContext.getService(serRefs[0]);
Hashtable icqAccountProperties = new Hashtable();
icqAccountProperties.put(AccountProperties.PASSWORD, "parolata");
icqAccountID = icqAccountManager.installAccount(
bundleContext, "85450845", icqAccountProperties);
osgiFilter =
"(&("+AccountManager.PROTOCOL_PROPERTY_NAME +"="+ProtocolNames.ICQ+")"
+"(" + AccountManager.ACCOUNT_ID_PROPERTY_NAME
+ "=" + icqAccountID.getAccountID() + "))";
serRefs = bundleContext.getServiceReferences(
ProtocolProviderService.class.getName(),
osgiFilter);
ProtocolProviderService icqProtocolProvider
= (ProtocolProviderService)bundleContext.getService(serRefs[0]);
logger.info("UI Service...[ STARTED ]");
bundleContext.registerService(
UIService.class.getName(), this.uiService, null);
logger.info("UI Service ...[REGISTERED]");
//communicatorMain.setContactList(contactListService);
communicatorMain.show();
loginWindow.show();
loginWindow.showLoginWindow();
}
finally
{
@ -94,9 +94,9 @@ public void start(BundleContext bundleContext) throws Exception
}
}
public void stop(BundleContext bundleContext) throws Exception
public void stop(BundleContext bundleContext) throws Exception
{
logger.info("UI Service ...[STOPED]");
logger.info("UI Service ...[STOPED]");
}
}

@ -22,46 +22,46 @@
public class LoginWindow extends JFrame {
private JLabel uinLabel = new JLabel(Messages.getString("uin"));
private JLabel passwdLabel = new JLabel(Messages.getString("passwd"));
private JTextField uinTextField = new JTextField();
private JTextField passwdTextField = new JTextField();
private JPanel labelsPanel = new JPanel(new GridLayout(0, 1));
private JPanel textFieldsPanel = new JPanel(new GridLayout(0, 1));
private JPanel mainPanel = new JPanel(new BorderLayout());
public LoginWindow(){
TransparentFrameBackground background = new TransparentFrameBackground(this);
background.add(mainPanel);
this.getContentPane().add(background);
this.init();
}
private void init() {
this.labelsPanel.add(uinLabel);
this.labelsPanel.add(passwdLabel);
this.textFieldsPanel.add(uinTextField);
this.textFieldsPanel.add(passwdTextField);
this.mainPanel.add(labelsPanel);
this.mainPanel.add(textFieldsPanel);
}
public void show(){
public void showLoginWindow(){
this.pack();
this.setVisible(true);
}
}

Loading…
Cancel
Save