com.arjuna.ats.internal.arjuna.recovery.Listener类的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(7.3k)|赞(0)|评价(0)|浏览(241)

本文整理了Java中com.arjuna.ats.internal.arjuna.recovery.Listener类的一些代码示例,展示了Listener类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Listener类的具体详情如下:
包路径:com.arjuna.ats.internal.arjuna.recovery.Listener
类名称:Listener

Listener介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

Display display = new Display();
final Shell shell = new Shell(display);
shell.setLayout(new GridLayout(1, false));
shell.setText("Hide Label");
button.setText("hide");
button.addListener(SWT.Selection, new Listener() {
  public void handleEvent(Event e) {
    Button b = (Button) e.widget;
    GridData data = (GridData) bHidden.getLayoutData();
    data.exclude = b.getSelection();
    bHidden.setVisible(!data.exclude);
    shell.layout(false);
shell.open();
while (!shell.isDisposed()) {
  if (!display.readAndDispatch())
    display.sleep();
display.dispose();

代码示例来源:origin: stackoverflow.com

public static void main( String[] args ) {
  Display display = new Display();
  Shell shell = new Shell( display );
  shell.setLayout( new FillLayout() );
  final Table table = new Table( shell, SWT.VIRTUAL );
  table.setItemCount( 10000 );
  table.addListener( SWT.SetData, new Listener() {
    public void handleEvent( Event event ) {
      TableItem item = (TableItem)event.item;
      item.setText( "Item " + table.indexOf( item ) );
    }
  } );
  shell.setSize( 300, 500 );
  shell.open();
  while( !shell.isDisposed() ) {
    if( !display.readAndDispatch() ) {
      display.sleep();
    }
  }
  display.dispose();
}

代码示例来源:origin: stackoverflow.com

shell.setLayout(new GridLayout(1, true));
button.setText("Resize");
button.addListener(SWT.Selection, new Listener()
    shell.layout();
shell.pack();
shell.open();
while (!shell.isDisposed())
  if (!display.readAndDispatch())
    display.sleep();
display.dispose();

代码示例来源:origin: stackoverflow.com

Display display = new Display ();
final Color green = display.getSystemColor (SWT.COLOR_GREEN);
final Color orig = shell.getBackground();
display.addFilter(SWT.KeyDown, new Listener() {
shell.addKeyListener(new KeyListener() {
  public void keyReleased(KeyEvent e) {
    if(((e.stateMask & SWT.CTRL) == SWT.CTRL) && (e.keyCode == 'f'))
      shell.setBackground(orig);
      System.out.println("Key up !!");

代码示例来源:origin: stackoverflow.com

public static void main(String[] args)
{
  final Display display = new Display();
  final Shell shell = new Shell(display);
  shell.setLayout(new FillLayout());
  shell.setText("StackOverflow");

  shell.addListener(SWT.Resize, new Listener()
  {
    @Override
    public void handleEvent(Event arg0)
    {
      if(shell.getMaximized())
        System.out.println("Maximize");
    }
  });

  shell.pack();
  shell.open();

  while (!shell.isDisposed())
  {
    if (!display.readAndDispatch())
    {
      display.sleep();
    }
  }
  display.dispose();
}

代码示例来源:origin: stackoverflow.com

Display display = new Display();
final Shell shell = new Shell(display);
shell.setText("StackOverflow");
shell.setLayout(new FillLayout());
button.setText("Calculate");
button.addListener(SWT.Selection, new Listener()
shell.pack();
shell.setSize(400, 200);
shell.open();

代码示例来源:origin: stackoverflow.com

final Display display = new Display();
final Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
dummy.setText("Dummy");
shell.addListener(SWT.Move, new Listener() {
shell.addListener(SWT.Iconify, new Listener() {
shell.open();
while (!shell.isDisposed()) {
  if (!display.readAndDispatch()) {
    display.sleep();

代码示例来源:origin: stackoverflow.com

final Display display = new Display();
final Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
button.setText("Change cursor");
button.addListener(SWT.Selection, new Listener() {
    shell.setCursor(cursor);
shell.setSize(200,200);
shell.open();
while (!shell.isDisposed()) {
  if (!display.readAndDispatch()) {
    display.sleep();

代码示例来源:origin: stackoverflow.com

public static void main( String[] args ) {
 Listener listener = new Listener() {
  @Override
  public void handleEvent( Event event ) {
   System.out.println( event );
  }
 };
 Display display = new Display();
 Shell shell = new Shell( display );
 shell.setText( "Shell" );
 shell.addListener( SWT.MouseDown, listener );
 Button button = new Button( shell, SWT.PUSH );
 button.setText( "Button" );
 button.setBounds( 100, 100, 400, 100 );
 button.addListener( SWT.MouseDown, listener );
 shell.setSize( 600, 600 );
 shell.open();
 while( !shell.isDisposed() ) {
  if( !display.readAndDispatch() )
   display.sleep();
 }
 display.dispose();
}

代码示例来源:origin: stackoverflow.com

composite.addListener(SWT.Resize, new Listener() {
  public void handleEvent(Event e) {
    changeImage();
Shell shell = new Shell(display);
try {
  shell.setSize(200, 100);
  shell.setLayout(new FillLayout());
  createComponents(shell);
  shell.open();
  while (!shell.isDisposed()) {
    if (!display.readAndDispatch()) {

代码示例来源:origin: stackoverflow.com

parent.setLayout(new FillLayout());
ScrolledComposite scrollBox = new ScrolledComposite(parent, SWT.V_SCROLL);
scrollBox.setExpandHorizontal(true);
mParent.addListener(SWT.Resize, new Listener() {
 int width = -1;
 public void handleEvent(Event e) {

代码示例来源:origin: org.jboss.narayana.jts/narayana-jts-idlj

/**
* The work item to be executed.
*
* this must be private as it should only be called once. otherwise we leak listener threads
*/
private void addService( Service service, ServerSocket serverSocket )
{
 try
 {
   _listener = new Listener( serverSocket, service );
   _listener.setDaemon(true);
   tsLogger.logger.debug(service.getClass().getName() + " starting");
   _listener.start() ;
 }
 catch ( IOException ex ) {
   tsLogger.i18NLogger.warn_recovery_TransactionStatusManager_2();
 }
}

代码示例来源:origin: stackoverflow.com

Display display = new Display();
Listener filter = new Listener() {
 @Override
 public void handleEvent( Event event ) {
  if( /* condition */ ) {
   event.doit = false;
  }
 }
};
display.addFilter( SWT.MouseDown, filter );

代码示例来源:origin: org.jboss.jbossts.arjunacore/arjuna

while ( !stopRequested() )
   if (addConnection(conn)) {

代码示例来源:origin: stackoverflow.com

private Label fieldLabel = new Label(shell, SWT.NONE);

public void testMethod()
{
  Button button = new Button(shell, SWT.PUSH);
  button.setText("Print");

  final Label finalLabel = new Label(shell, SWT.NONE);

  button.addListener(SWT.Selection, new Listener(){
    @Override
    public void handleEvent(Event e)
    {
      fieldLabel.setText("TEXT");
      finalLabel.setTexT("TEXT");
    }
  })
}

代码示例来源:origin: jbosstm/narayana

/**
* Halts running of the listener thread.
*/
public synchronized void stopListener()
{
  closeListenerSockets();
 // there is no need for this as the close will interrupt any i/o that is in progress
 // this.interrupt();
  // ok, closing a connection socket will cause the connection thread to remove it from the list as it
  // exits so we keep on closing them and waiting until the list is empty
  while(connections.size() > 0) {
    Socket conn = connections.get(0);
    try {
      conn.close();
    } catch (Exception e) {
      // ignore
    }
    try {
      wait();
    } catch (InterruptedException e) {
      // ignore
    }
  }
 
  // make sure this listener thread has exited before we return
  try {
    this.join();
  } catch (InterruptedException ie) {
  }
}

代码示例来源:origin: org.jboss.narayana.arjunacore/arjunacore

_listener.closeListenerSockets();
_listener.stopListener();

代码示例来源:origin: jboss.jbossts/jbossjts

public void shutdown()
{
  if (_listener != null) {
    _listener.stopListener() ;
    TransactionStatusManagerItem.removeThis( Utility.getProcessUid() ) ;
    _listener = null;
  }
}
/**

代码示例来源:origin: org.jboss.jbossts/jbossjta

public void run() {
    removeConnection(_conn);
  }
};

代码示例来源:origin: stackoverflow.com

final Button setButton = new Button(composite, SWT.PUSH);
setButton.setText("Set");
setButton.addSelectionListener(new SelectionAdapter() {
  public void widgetSelected(final SelectionEvent e) {
    // some code here
  }
});

MenuItem clickMenuItem = new MenuItem(testMenu, SWT.PUSH);
clickMenuItem.setText("Click");
clickMenuItem.addListener(SWT.Selection, new Listener() {
  public void handleEvent(Event event) {
    setButton.notifyListeners(SWT.Selection, new Event());
  }
});

相关文章