Package net.sphene.goim.rcp.extensionpoints.GameExtensionPoint

Examples of net.sphene.goim.rcp.extensionpoints.GameExtensionPoint.GameExtensionProxy


    private GameServer server;
    public ServerQuery(GameServer server) {
      this.server = server;
    }
    public void run() {
      GameExtensionProxy extension = server.getGameExtension();
      if (extension.getDelegate() instanceof GameAdapterWithServerName) {
        GameAdapterWithServerName gameAdapter = (GameAdapterWithServerName) extension
            .getDelegate();
        try {
          ServerQueryInformation query = gameAdapter
              .queryServer(server.address);
          if (query == null) {
View Full Code Here


    return game.retrieveExtensionProxy().name;
  }

  @Override
  public String getTooltipText(GOIMGameItem game, IGameExtension gameEx) {
    GameExtensionProxy proxy = gameEx.getGameExtension();
    return proxy.name;
  }
View Full Code Here

    while(i.hasNext()) {
      Object o = i.next();
      if(o instanceof IGameExtension) {
        final IGameExtension gameEx = (IGameExtension)o;
        final GOIMGameItem game = gameEx.getGameItem();
        final GameExtensionProxy proxy = gameEx.getGameExtension();
        final InetSocketAddress target = gameEx.getDestination();
        Label label = new Label(games,SWT.NULL);
        tk.adapt(label,false,false);
        label.setImage(proxy.getIcon().createImage());
        label.setToolTipText(proxy.name + ": " + GameAdapter.GameStatusExtension.formatSocketAddress(target));
        label.setEnabled(false);
        if(game != null) {
          label.addListener(SWT.MouseUp,new Listener() {
 
            public void handleEvent(Event event) {
              proxy.execute(game,gameEx);
            } });
        } else {
          label.setToolTipText("Game not installed: " + label.getToolTipText());
        }
      }
View Full Code Here

    delCommand.setEnabled(customize);
  }
  private void updateDefaultCommand() {
    String defaultCommand = "";
    if(comboGame.getSelectionIndex() > -1) {
      GameExtensionProxy proxy = games.get(comboGame.getSelectionIndex());
      if(proxy != null) {
        IGame delegate = proxy.getDelegate();
        if(delegate instanceof GameAdapter) {
          defaultCommand = "Default Connect Command: " + proxy.getDefaultConnectCommand();
        }
      }
    }
    this.defaultCommand.setText(defaultCommand);
  }
View Full Code Here

  private void createTableItem(GOIMGameItem item) {
    TableItem tableItem = new TableItem(gamesTable, SWT.NULL);
    updateTableItem(item,tableItem);
  }
  private void updateTableItem(GOIMGameItem item, TableItem tableItem) {
    GameExtensionProxy proxy = item.retrieveExtensionProxy(true);
    if(proxy == null) { tableItem.dispose(); return; }
    tableItem.setImage(proxy.getIcon().createImage());
    tableItem.setText(new String[] { "",proxy.name, item.version, item.path });
//    TableEditor editor = (TableEditor)tableItem.getData("editor");
//    if(editor == null) {
//      editor = new TableEditor(gamesTable);
//      editor.minimumWidth = 16;
View Full Code Here

          extensions++;
          if (editor == null)
            editor = getEditor(item, true);
          final IGameExtension gameEx = (IGameExtension) ex;
          final GOIMGameItem game = gameEx.getGameItem();
          final GameExtensionProxy proxy = gameEx.getGameExtension();
          // final InetSocketAddress target = gameEx.getDestination();
          Label label = new Label((Composite) editor.getEditor(),
              SWT.NULL);
          // Button label = new
          // Button((Composite)editor.getEditor(),SWT.PUSH);
          try {
            label.setImage(proxy.getIcon().createImage());
          } catch(SWTError error) {
            error.printStackTrace();
            // Since we still want the user to know about the error .. i throw an exception for now ..
            throw new RuntimeException("An SWT Error occurred during setting game icon",error);
          }
          label.setToolTipText(proxy.getTooltipText(game, gameEx));
          System.out.println("Addin label with image: " + proxy.icon
              + ": " + label.computeSize(-1, -1));
          // label.setEnabled(true);
          // label.setText("Muh");
          label.setLayoutData(new RowData(16,16));
          if (game != null) {
            label.addListener(SWT.MouseUp, new Listener() {

              public void handleEvent(Event event) {
                //System.out.println("mouseup");
                proxy.execute(game, gameEx);
              }
            });
            label.setFocus();
          } else {
            label.setToolTipText("Game not installed: "
View Full Code Here

  }
  public boolean needsOnlineStatusChange(GOIMGameItem item) {
    return getCurrentDestination(item) != null && item.retrieveExtensionProxy().changestatus;
  }
  public String getTooltipText(GOIMGameItem game, IGameExtension gameEx) {
    GameExtensionProxy proxy = gameEx.getGameExtension();
    return proxy.name + ": " + GameStatusExtension.formatSocketAddress(gameEx.getDestination());
  }
View Full Code Here

          if(name.equals("xmlns") || name.equals("game") || name.equals("target"))
            continue;
          atts.put(parser.getAttributeName(i),parser.getAttributeValue(i));
        }
        if(atts.size() < 1) atts = null;
        GameExtensionProxy proxy = GameExtensionPoint.getGameExtension(gameId);
        GOIMGameItem game = null;
        for(GOIMGameItem item : list) {
          if(item.gameId.equals(gameId)) {
            game = item;
            break;
View Full Code Here

TOP

Related Classes of net.sphene.goim.rcp.extensionpoints.GameExtensionPoint.GameExtensionProxy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.