当前位置: 首页>>代码示例>>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;未经允许,请勿转载。