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


Java FocusAdapter類代碼示例

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


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

示例1: open

import org.eclipse.swt.events.FocusAdapter; //導入依賴的package包/類
/**
 * Activates the editor at the given position.
 * 
 * @param row
 * @param col
 * @param rect
 */
public void open(KTable table, int col, int row, Rectangle rect) {
  m_Table = table;
  m_Model = table.getModel();
  m_Rect = rect;
  m_Row = row;
  m_Col = col;
  if (m_Control == null) {
    m_Control = createControl();
    m_Control.setToolTipText(toolTip);
    m_Control.addFocusListener(new FocusAdapter() {
      public void focusLost(FocusEvent arg0) {
        close(true);
      }
    });
  }
  setBounds(m_Rect);
  GC gc = new GC(m_Table);
  m_Table.drawCell(gc, m_Col, m_Row);
  gc.dispose();
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:28,代碼來源:KTableCellEditor.java

示例2: edit

import org.eclipse.swt.events.FocusAdapter; //導入依賴的package包/類
private void edit(final TableItem item, final TableEditor tableEditor) {
    final Text text = new Text(table, SWT.NONE);
    text.setText(item.getText(targetColumn));

    text.addFocusListener(new FocusAdapter() {

        @Override
        public void focusLost(final FocusEvent e) {
            item.setText(targetColumn, text.getText());
            text.dispose();
        }

    });

    tableEditor.setEditor(text, item, targetColumn);
    text.setFocus();
    text.selectAll();
}
 
開發者ID:roundrop,項目名稱:ermasterr,代碼行數:19,代碼來源:ModelPropertiesDialog.java

示例3: edit

import org.eclipse.swt.events.FocusAdapter; //導入依賴的package包/類
private void edit(final TableItem item, final TableEditor tableEditor) {
	final Text text = new Text(table, SWT.NONE);
	text.setText(item.getText(targetColumn));

	text.addFocusListener(new FocusAdapter() {

		@Override
		public void focusLost(FocusEvent e) {
			item.setText(targetColumn, text.getText());
			text.dispose();
		}

	});

	tableEditor.setEditor(text, item, targetColumn);
	text.setFocus();
	text.selectAll();
}
 
開發者ID:kozake,項目名稱:ermaster-k,代碼行數:19,代碼來源:ModelPropertiesDialog.java

示例4: setupProperties

import org.eclipse.swt.events.FocusAdapter; //導入依賴的package包/類
/**
 * In a future world, this might provide access to a complete set
 * of {@code ResourceDocument} properties.
 */
@SuppressWarnings("unused")
private Composite setupProperties(Composite parent) {
  Composite result = Widgets.buildGridContainer(parent, 2);

  Label label = Widgets.buildCompactLabel(result, "&Name:");

  relSetName = new Text(result, SWT.BORDER | SWT.SINGLE);
  relSetName.setLayoutData(Widgets.buildHorzFillData());
  relSetName.addFocusListener(new FocusAdapter() {
    @Override
    public void focusLost(FocusEvent e) {
      if (propInfo.getName().equals(relSetName.getText())) {
        return;
      }
      setDirtyState(true);
      handleDocumentChange();
    }
  });
  return result;
}
 
開發者ID:google,項目名稱:depan,代碼行數:25,代碼來源:RelationDisplayEditor.java

示例5: setupProperties

import org.eclipse.swt.events.FocusAdapter; //導入依賴的package包/類
/**
 * In a future world, this might provide access to a complete set
 * of {@code ResourceDocument} properties.
 */
@SuppressWarnings("unused")
private Composite setupProperties(Composite parent) {
  Composite result = Widgets.buildGridContainer(parent, 2);

  Label label = Widgets.buildCompactLabel(result, "&Name:");

  matcherName = new Text(result, SWT.BORDER | SWT.SINGLE);
  matcherName.setLayoutData(Widgets.buildHorzFillData());
  if (null != matcherInfo) {
    matcherName.setText(matcherInfo.getName());
  }
  matcherName.addFocusListener(new FocusAdapter() {
    @Override
    public void focusLost(FocusEvent e) {
      if (matcherInfo.getName().equals(matcherName.getText())) {
        return;
      }
      setDirtyState(true);
      handleDocumentChange();
    }
  });
  return result;
}
 
開發者ID:google,項目名稱:depan,代碼行數:28,代碼來源:EdgeMatcherEditor.java

示例6: setupProperties

import org.eclipse.swt.events.FocusAdapter; //導入依賴的package包/類
/**
 * In a future world, this might provide access to a complete set
 * of {@code ResourceDocument} properties.
 * @return 
 */
@SuppressWarnings("unused")
private Composite setupProperties(Composite parent) {
  Composite result = Widgets.buildGridContainer(parent, 2);

  Label label = Widgets.buildCompactLabel(result, "&Name:");

  relSetName = new Text(result, SWT.BORDER | SWT.SINGLE);
  relSetName.setLayoutData(Widgets.buildHorzFillData());
  relSetName.addFocusListener(new FocusAdapter() {
    @Override
    public void focusLost(FocusEvent e) {
      if (relSetInfo.getName().equals(relSetName.getText())) {
        return;
      }
      setDirtyState(true);
      handleDocumentChange();
    }
  });
  return result;
}
 
開發者ID:google,項目名稱:depan,代碼行數:26,代碼來源:RelationSetDescriptorEditor.java

示例7: createDescription

import org.eclipse.swt.events.FocusAdapter; //導入依賴的package包/類
private void createDescription(String text, Composite comp, StyleRange[] styles) {
	final StyledText descLabel = new StyledText(comp, SWT.MULTI | SWT.WRAP);
	descLabel.setRightMargin(10);
	descLabel.setEditable(false);
	descLabel.setText(text);
	descLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	descLabel.addMouseListener(compositeMouseAction);
	if (styles != null && styles.length > 0)
		descLabel.setStyleRanges(styles);
	descLabel.addFocusListener(new FocusAdapter() {

		@Override
		public void focusGained(FocusEvent e) {
			setScrolledFocus();
			descLabel.setSelection(0, 0);
		}

	});
}
 
開發者ID:OpenSoftwareSolutions,項目名稱:PDFReporter-Studio,代碼行數:20,代碼來源:SelectableComposite.java

示例8: edit

import org.eclipse.swt.events.FocusAdapter; //導入依賴的package包/類
private void edit(final TableItem item, final TableEditor tableEditor) {
    final Text text = new Text(table, SWT.NONE);
    text.setText(item.getText(targetColumn));

    text.addFocusListener(new FocusAdapter() {

        @Override
        public void focusLost(FocusEvent e) {
            item.setText(targetColumn, text.getText());
            text.dispose();
        }
    });

    tableEditor.setEditor(text, item, targetColumn);
    text.setFocus();
    text.selectAll();
}
 
開發者ID:dbflute-session,項目名稱:erflute,代碼行數:18,代碼來源:ModelPropertiesDialog.java

示例9: AutoComplete

import org.eclipse.swt.events.FocusAdapter; //導入依賴的package包/類
public AutoComplete(final ComboViewer comboViewer) {

		_comboViewer = comboViewer;

		final Combo combo = comboViewer.getCombo();

		combo.addKeyListener(new KeyAdapter() {
			@Override
			public void keyReleased(final KeyEvent e) {
				if (e.keyCode == SWT.DEL)
					setSelection(null);
				autoCompleteKeyUp(e);
			}

		});

		combo.addFocusListener(new FocusAdapter() {
			@Override
			public void focusLost(final FocusEvent arg0) {
				autoCompleteLeave();
			}
		});

	}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:25,代碼來源:AutoComplete.java

示例10: validEquiTxt

import org.eclipse.swt.events.FocusAdapter; //導入依賴的package包/類
/**
 * 驗證用戶輸入的加權係數的正確性
 * @param equiTxt
 */
private void validEquiTxt(final Text equiTxt){
	final String defaultStr = "0.50";
	equiTxt.setText(defaultStr);
	equiTxt.addFocusListener(new FocusAdapter() {
		@Override
		public void focusLost(FocusEvent e) {
			String textStr = equiTxt.getText().trim();
			if (textStr == null || textStr.trim().length() == 0) {
				equiTxt.setText(defaultStr);
			}else {
				String regular = "1\\.(0){0,2}|0\\.\\d{0,2}";
				if (!textStr.matches(regular)) {
					MessageDialog.openInformation(getShell(), Messages.getString("preference.EquivalentPage.msgTitle"), 
						Messages.getString("preference.EquivalentPage.msg5"));
					equiTxt.setText(defaultStr);
				}
			}
		}
	});
}
 
開發者ID:heartsome,項目名稱:translationstudio8,代碼行數:25,代碼來源:EquivalentPage.java

示例11: createDialogArea

import org.eclipse.swt.events.FocusAdapter; //導入依賴的package包/類
protected Control createDialogArea(Composite parent) {
	text = new Text(parent, SWT.MULTI | SWT.READ_ONLY | SWT.WRAP
			| SWT.NO_FOCUS);

	// Use the compact margins employed by PopupDialog.
	GridData gd = new GridData(GridData.BEGINNING
			| GridData.FILL_BOTH);
	gd.horizontalIndent = PopupDialog.POPUP_HORIZONTALSPACING;
	gd.verticalIndent = PopupDialog.POPUP_VERTICALSPACING;
	text.setLayoutData(gd);
	text.setText(contents);

	// since SWT.NO_FOCUS is only a hint...
	text.addFocusListener(new FocusAdapter() {
		public void focusGained(FocusEvent event) {
			ContentProposalPopup.this.close();
		}
	});
	return text;
}
 
開發者ID:ghillairet,項目名稱:gef-gwt,代碼行數:21,代碼來源:ContentProposalAdapter.java

示例12: buildTableLine

import org.eclipse.swt.events.FocusAdapter; //導入依賴的package包/類
/**
 * @param factory
 *            factory to use.
 */
protected void buildTableLine(final PluginWidgetFactory factory) {
    final Control topControl = this.wConnection;

    this.wlTable = factory.createRightLabel(BaseMessages.getString(PKG, "TeraFastDialog.TargetTable.Label"));
    this.props.setLook(this.wlTable);
    this.wlTable.setLayoutData(factory.createLabelLayoutData(topControl));

    this.wTable = factory.createSingleTextVarLeft();
    this.props.setLook(this.wTable);
    this.wTable.setLayoutData(factory.createControlLayoutData(topControl));

    this.wTable.addFocusListener(new FocusAdapter() {
        @Override
        public void focusLost(final FocusEvent event) {
            setTableFieldCombo();
        }
    });
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:23,代碼來源:TeraFastDialog.java

示例13: createContainer

import org.eclipse.swt.events.FocusAdapter; //導入依賴的package包/類
public Composite createContainer(Composite parent, ICallback h){
	handler = h;
	etf = new EnhancedTextField(parent);
	etf.text.addFocusListener(new FocusAdapter() {
		@Override
		public void focusLost(FocusEvent e){
			if (bSaveOnFocusLost) {
				if (handler != null) {
					handler.save();
				}
			}
		}
		
	});
	ike = new ExternalLink();
	ike.connect(etf);
	etf.setText(StringTool.leer);
	return etf;
}
 
開發者ID:elexis,項目名稱:elexis-3-core,代碼行數:20,代碼來源:ETFTextPlugin.java

示例14: buildTableLine

import org.eclipse.swt.events.FocusAdapter; //導入依賴的package包/類
/**
 * @param factory
 *          factory to use.
 */
protected void buildTableLine( final PluginWidgetFactory factory ) {
  final Control topControl = this.wConnection;

  this.wlTable = factory.createRightLabel( BaseMessages.getString( PKG, "TeraFastDialog.TargetTable.Label" ) );
  this.props.setLook( this.wlTable );
  this.wlTable.setLayoutData( factory.createLabelLayoutData( topControl ) );

  this.wTable = factory.createSingleTextVarLeft();
  this.props.setLook( this.wTable );
  this.wTable.setLayoutData( factory.createControlLayoutData( topControl ) );

  this.wTable.addFocusListener( new FocusAdapter() {
    @Override
    public void focusLost( final FocusEvent event ) {
      setTableFieldCombo();
    }
  } );
}
 
開發者ID:pentaho,項目名稱:pentaho-kettle,代碼行數:23,代碼來源:TeraFastDialog.java

示例15: createValueTextarea

import org.eclipse.swt.events.FocusAdapter; //導入依賴的package包/類
protected Composite createValueTextarea(Composite parent) {
	Label valueLabel = createDescription(parent, MetamodelViewsRepository.Query.Properties.value, MetamodelMessages.QueryPropertiesEditionPart_ValueLabel);
	GridData valueLabelData = new GridData(GridData.FILL_HORIZONTAL);
	valueLabelData.horizontalSpan = 3;
	valueLabel.setLayoutData(valueLabelData);
	value = SWTUtils.createScrollableText(parent, SWT.BORDER | SWT.WRAP | SWT.MULTI | SWT.V_SCROLL);
	GridData valueData = new GridData(GridData.FILL_HORIZONTAL);
	valueData.horizontalSpan = 2;
	valueData.heightHint = 80;
	valueData.widthHint = 200;
	value.setLayoutData(valueData);
	value.addFocusListener(new FocusAdapter() {

		/**
		 * {@inheritDoc}
		 * 
		 * @see org.eclipse.swt.events.FocusAdapter#focusLost(org.eclipse.swt.events.FocusEvent)
		 * 
		 */
		public void focusLost(FocusEvent e) {
			if (propertiesEditionComponent != null)
				propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(QueryPropertiesEditionPartImpl.this, MetamodelViewsRepository.Query.Properties.value, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, value.getText()));
		}

	});
	EditingUtils.setID(value, MetamodelViewsRepository.Query.Properties.value);
	EditingUtils.setEEFtype(value, "eef::Textarea"); //$NON-NLS-1$
	SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(MetamodelViewsRepository.Query.Properties.value, MetamodelViewsRepository.SWT_KIND), null); //$NON-NLS-1$
	// Start of user code for createValueTextArea

	// End of user code
	return parent;
}
 
開發者ID:cetic,項目名稱:SimQRI,代碼行數:34,代碼來源:QueryPropertiesEditionPartImpl.java


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