當前位置: 首頁>>代碼示例>>Java>>正文


Java TraverseListener類代碼示例

本文整理匯總了Java中org.eclipse.swt.events.TraverseListener的典型用法代碼示例。如果您正苦於以下問題:Java TraverseListener類的具體用法?Java TraverseListener怎麽用?Java TraverseListener使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


TraverseListener類屬於org.eclipse.swt.events包,在下文中一共展示了TraverseListener類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createControl

import org.eclipse.swt.events.TraverseListener; //導入依賴的package包/類
protected Control createControl() {
  m_Text = new Text(m_Table, SWT.MULTI | SWT.V_SCROLL | SWT.WRAP);
  m_Text.addKeyListener(new KeyAdapter() {
    public void keyPressed(KeyEvent e) {
      try {
        onKeyPressed(e);
      } catch (Exception ex) {
      }
    }
  });
  m_Text.addTraverseListener(new TraverseListener() {
    public void keyTraversed(TraverseEvent arg0) {
      onTraverse(arg0);
    }
  });
  return m_Text;
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:18,代碼來源:KTableCellEditorMultilineWrapText.java

示例2: createControl

import org.eclipse.swt.events.TraverseListener; //導入依賴的package包/類
protected Control createControl() {
  // System.out.println("Created a new one.");
  m_Text = new Text(m_Table, SWT.NONE);
  m_Text.addKeyListener(new KeyAdapter() {
    public void keyPressed(KeyEvent e) {
      try {
        onKeyPressed(e);
      } catch (Exception ex) {
      }
    }
  });
  m_Text.addTraverseListener(new TraverseListener() {
    public void keyTraversed(TraverseEvent arg0) {
      onTraverse(arg0);
    }
  });
  return m_Text;
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:19,代碼來源:KTableCellEditorText.java

示例3: createControl

import org.eclipse.swt.events.TraverseListener; //導入依賴的package包/類
protected Control createControl() {
  m_Text = new Text(m_Table, SWT.MULTI | SWT.V_SCROLL);
  m_Text.addKeyListener(new KeyAdapter() {
    public void keyPressed(KeyEvent e) {
      try {
        onKeyPressed(e);
      } catch (Exception ex) {
      }
    }
  });
  m_Text.addTraverseListener(new TraverseListener() {
    public void keyTraversed(TraverseEvent arg0) {
      onTraverse(arg0);
    }
  });
  return m_Text;
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:18,代碼來源:KTableCellEditorMultilineText.java

示例4: ParameterGridDialog

import org.eclipse.swt.events.TraverseListener; //導入依賴的package包/類
/**
 * Create the dialog.
 * @param parentShell
 */
public ParameterGridDialog(Shell parentShell) {
	super(parentShell);
	setShellStyle(SWT.CLOSE | SWT.RESIZE | SWT.TITLE | SWT.WRAP | SWT.APPLICATION_MODAL);
	runGraph=false;
	
	
	lastRowLastColumnTraverseListener=new TraverseListener() {
		
		@Override
		public void keyTraversed(TraverseEvent e) {
			if(e.detail == SWT.TRAVERSE_TAB_NEXT)
				addRowToTextGrid();
		}
	};
	
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:21,代碼來源:ParameterGridDialog.java

示例5: ToolStripTabs

import org.eclipse.swt.events.TraverseListener; //導入依賴的package包/類
public ToolStripTabs(final Composite parent, final ToolStripTabPage[] tabs, final int style) {
    super(parent, style);
    this.tabs = tabs;
    imageHelper = new ImageHelper(TFSTeamBuildPlugin.PLUGIN_ID);
    createControls(this);
    setSelectedPage(0);
    addTraverseListener(new TraverseListener() {
        @Override
        public void keyTraversed(final TraverseEvent e) {
            if (e.detail == SWT.TRAVERSE_PAGE_NEXT) {
                traverseToNextPage(true);
                return;
            }
            if (e.detail == SWT.TRAVERSE_PAGE_PREVIOUS) {
                traverseToNextPage(false);
                return;
            }
        }
    });
}
 
開發者ID:Microsoft,項目名稱:team-explorer-everywhere,代碼行數:21,代碼來源:ToolStripTabs.java

示例6: addTraverseListener

import org.eclipse.swt.events.TraverseListener; //導入依賴的package包/類
private void addTraverseListener() {
	addTraverseListener(new TraverseListener() {

		@Override
		public void keyTraversed(final TraverseEvent event) {

			/*
			 * traverse with the tab key to the next/previous control
			 */
			switch (event.detail) {
			case SWT.TRAVERSE_TAB_NEXT:
			case SWT.TRAVERSE_TAB_PREVIOUS:
				event.doit = true;
				break;
			}
		}
	});
}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:19,代碼來源:GalleryMT20.java

示例7: createHeader

import org.eclipse.swt.events.TraverseListener; //導入依賴的package包/類
private Control createHeader(Composite parent, Font font, String message) {
	Composite header= new Composite(parent, SWT.NONE);
	GridLayout layout= new GridLayout();
	layout.numColumns= 2;
	layout.marginWidth= 0; layout.marginHeight= 0;
	header.setLayout(layout);
	header.setFont(font);
	Label label= new Label(header, SWT.NONE);
	label.setText(message);
	label.setFont(font);
	label.addTraverseListener(new TraverseListener() {
		public void keyTraversed(TraverseEvent e) {
			if (e.detail == SWT.TRAVERSE_MNEMONIC && e.doit) {
				e.detail= SWT.TRAVERSE_NONE;
				fFilter.setFocus();
			}
		}
	});
	GridData gd= new GridData(GridData.FILL_HORIZONTAL);
	label.setLayoutData(gd);
	
	createViewMenu(header);
	return header;
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:25,代碼來源:TypeSelectionComponent.java

示例8: createTextControl

import org.eclipse.swt.events.TraverseListener; //導入依賴的package包/類
@Override
protected Text createTextControl(Composite parent) {
	Text text= new Text(parent, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
	text.addTraverseListener(new TraverseListener() {
		public void keyTraversed(TraverseEvent event) {
			switch (event.detail) {
				case SWT.TRAVERSE_ESCAPE:
				case SWT.TRAVERSE_PAGE_NEXT:
				case SWT.TRAVERSE_PAGE_PREVIOUS:
					event.doit= true;
					break;
				case SWT.TRAVERSE_RETURN:
				case SWT.TRAVERSE_TAB_NEXT:
				case SWT.TRAVERSE_TAB_PREVIOUS:
					if ((event.stateMask & SWT.MODIFIER_MASK) != 0) {
						event.doit= true;
					}
					break;
			}

		}
	});
	return text;
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:25,代碼來源:TextBoxDialogField.java

示例9: getTraverseListener

import org.eclipse.swt.events.TraverseListener; //導入依賴的package包/類
private TraverseListener getTraverseListener( )
{
	return new TraverseListener( ) {

		/**
		 * @see org.eclipse.swt.events.TraverseListener#keyTraversed(TraverseEvent)
		 */
		public void keyTraversed( TraverseEvent e )
		{
			if ( e.widget instanceof StyledText )
			{
				if ( ( e.detail == SWT.TRAVERSE_TAB_NEXT )
						|| ( e.detail == SWT.TRAVERSE_TAB_PREVIOUS ) )
					e.doit = true;
			}
		}
	};
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:19,代碼來源:ExpressionSyntaxColoringPage.java

示例10: createListeners

import org.eclipse.swt.events.TraverseListener; //導入依賴的package包/類
@Override
public void createListeners() {
	write.addTraverseListener(new TraverseListener() {

		@Override
		public void keyTraversed(TraverseEvent e) {
			if (e.detail == SWT.TRAVERSE_RETURN) {
				if (write.getText().replaceAll(" ", "").isEmpty())
					return;

				Messaging.getInstance().sendChatMessage(staff, write.getText());

				write.setText("");
			}
		}
	});
}
 
開發者ID:coddo,項目名稱:TeamSubb,代碼行數:18,代碼來源:TextFields.java

示例11: createTableViewer

import org.eclipse.swt.events.TraverseListener; //導入依賴的package包/類
public TableViewer createTableViewer(Composite composite, String[] prop,
		int[] bounds, int columnWidth,
		IStructuredContentProvider iStructuredContentProvider,
		ITableLabelProvider iTableLabelProvider) {
	final TableViewer tableViewer = new TableViewer(composite, SWT.BORDER
			| SWT.MULTI | SWT.FULL_SELECTION | SWT.VIRTUAL);

	Table table = tableViewer.getTable();
	table.setBounds(bounds[0], bounds[1], bounds[2], bounds[3]);
	tableViewer.setContentProvider(iStructuredContentProvider);
	tableViewer.setLabelProvider(iTableLabelProvider);
	tableViewer.setColumnProperties(prop);
	tableViewer.getTable().addTraverseListener(new TraverseListener() {

		@Override
		public void keyTraversed(TraverseEvent e) {
			if (e.keyCode == SWT.ARROW_UP) {
				e.doit = false;
			} else if (e.keyCode == SWT.ARROW_DOWN) {
				e.doit = false;
			} else if (e.keyCode == SWT.TRAVERSE_ARROW_NEXT) {
				e.doit = false;
			} else if (e.keyCode == SWT.TRAVERSE_ARROW_PREVIOUS) {
				e.doit = false;
			}

		}
	});

	table.setVisible(true);
	table.setLinesVisible(true);
	table.setHeaderVisible(true);
	/*
	 * createTableColumns(table,prop, columnWidth); CellEditor[] editors
	 * =createCellEditorList(table,1); tableViewer.setCellEditors(editors);
	 */

	return tableViewer;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:40,代碼來源:ELTSWTWidgets.java

示例12: configureShell

import org.eclipse.swt.events.TraverseListener; //導入依賴的package包/類
@Override
protected void configureShell(Shell shell) {
	super.configureShell(shell);
	shell.setText(job.getName());
	shell.addTraverseListener(new TraverseListener() {
		@Override
		public void keyTraversed(TraverseEvent e) {
			if (e.detail == SWT.TRAVERSE_ESCAPE) {
				cancelPressed();
				e.detail = SWT.TRAVERSE_NONE;
				e.doit = true;
			}
		}
	});
}
 
開發者ID:termsuite,項目名稱:termsuite-ui,代碼行數:16,代碼來源:ProgressMonitorFocusJobDialog.java

示例13: hookAddToDialogArea

import org.eclipse.swt.events.TraverseListener; //導入依賴的package包/類
@Override
protected void hookAddToDialogArea(final Composite dialogArea) {
    final GridLayout layout = new GridLayout();
    layout.marginWidth = getHorizontalMargin();
    layout.marginHeight = getVerticalMargin();
    layout.horizontalSpacing = getHorizontalSpacing();
    layout.verticalSpacing = getVerticalSpacing();
    dialogArea.setLayout(layout);

    SWTUtil.createLabel(dialogArea, Messages.getString("WorkspacesDialog.WorkspacesLabelText")); //$NON-NLS-1$

    control = new WorkspacesControl(dialogArea, SWT.NONE);
    GridDataBuilder.newInstance().grab().fill().applyTo(control);
    control.getWorkspacesTable().addDoubleClickListener(new IDoubleClickListener() {
        @Override
        public void doubleClick(final DoubleClickEvent event) {
            WorkspacesDialog.this.onWorkspacesTableDoubleClick(event);
        }
    });
    control.getWorkspacesTable().addTraverseListener(new TraverseListener() {
        @Override
        public void keyTraversed(final TraverseEvent e) {
            WorkspacesDialog.this.onWorkspacesTableKeyTraversed(e);
        }
    });

    control.refresh(connection, createWorkspaceIfNone, true);
}
 
開發者ID:Microsoft,項目名稱:team-explorer-everywhere,代碼行數:29,代碼來源:WorkspacesDialog.java

示例14: createControls

import org.eclipse.swt.events.TraverseListener; //導入依賴的package包/類
private void createControls(final Composite composite) {
    final GridLayout layout = SWTUtil.gridLayout(composite, 1);
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    layout.horizontalSpacing = getHorizontalSpacing();
    layout.verticalSpacing = getVerticalSpacing();

    SWTUtil.createLabel(composite, Messages.getString("GeneralTabPage.BuildNameLabelText")); //$NON-NLS-1$

    nameText = new Text(composite, SWT.BORDER);
    GridDataBuilder.newInstance().fill().applyTo(nameText);

    SWTUtil.createLabel(composite, Messages.getString("GeneralTabPage.DescriptionLabelText")); //$NON-NLS-1$

    descText = new Text(composite, SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
    descText.addTraverseListener(new TraverseListener() {
        @Override
        public void keyTraversed(final TraverseEvent e) {
            if (e.detail == SWT.TRAVERSE_TAB_NEXT || e.detail == SWT.TRAVERSE_TAB_PREVIOUS) {
                e.doit = true;
            }
        }
    });
    GridDataBuilder.newInstance().fill().grab().applyTo(descText);

    disableButton =
        SWTUtil.createButton(composite, SWT.CHECK, Messages.getString("GeneralTabPage.DisableButtonText")); //$NON-NLS-1$

}
 
開發者ID:Microsoft,項目名稱:team-explorer-everywhere,代碼行數:30,代碼來源:GeneralTabPage.java

示例15: createButtonsForButtonBar

import org.eclipse.swt.events.TraverseListener; //導入依賴的package包/類
protected void createButtonsForButtonBar( Composite parent){
   Button ok = createButton(parent, IDialogConstants.OK_ID, "Import Packet", true);
   createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
   ok.addMouseListener(okListener);
   ok.addTraverseListener(new TraverseListener() {

      public void keyTraversed( TraverseEvent e){
         if (SWT.TRAVERSE_RETURN == e.detail) {
         }
      }
   });
}
 
開發者ID:nextinterfaces,項目名稱:http4e,代碼行數:13,代碼來源:ImportDialog.java


注:本文中的org.eclipse.swt.events.TraverseListener類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。