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


Java SourceViewer.getTextWidget方法代碼示例

本文整理匯總了Java中org.eclipse.jface.text.source.SourceViewer.getTextWidget方法的典型用法代碼示例。如果您正苦於以下問題:Java SourceViewer.getTextWidget方法的具體用法?Java SourceViewer.getTextWidget怎麽用?Java SourceViewer.getTextWidget使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.jface.text.source.SourceViewer的用法示例。


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

示例1: buildEditorText

import org.eclipse.jface.text.source.SourceViewer; //導入方法依賴的package包/類
private StyledText buildEditorText( Composite parent){
   final SourceViewer sourceViewer = new SourceViewer(parent, null, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);
   final HConfiguration sourceConf = new HConfiguration(HContentAssistProcessor.PARAM_PROCESSOR);
   sourceViewer.configure(sourceConf);
   sourceViewer.setDocument(DocumentUtils.createDocument1());

   sourceViewer.getControl().addKeyListener(new KeyAdapter() {

      public void keyPressed( KeyEvent e){
         // if ((e.character == ' ') && ((e.stateMask & SWT.CTRL) != 0)) {
         if (Utils.isAutoAssistInvoked(e)) {
            IContentAssistant ca = sourceConf.getContentAssistant(sourceViewer);
            ca.showPossibleCompletions();
         }
      }
   });

   return sourceViewer.getTextWidget();
}
 
開發者ID:nextinterfaces,項目名稱:http4e,代碼行數:20,代碼來源:ParameterizeTextView.java

示例2: buildEditorText

import org.eclipse.jface.text.source.SourceViewer; //導入方法依賴的package包/類
private StyledText buildEditorText( Composite parent){
   final SourceViewer sourceViewer = new SourceViewer(parent, null, SWT.MULTI | SWT.V_SCROLL | SWT.WRAP);

   final XMLConfiguration sourceConf = new XMLConfiguration(new ColorManagerAdaptor(ResourceUtils.getResourceCache()));
   sourceViewer.configure(sourceConf);
   sourceViewer.setDocument(DocumentUtils.createDocument2());

   return sourceViewer.getTextWidget();
}
 
開發者ID:nextinterfaces,項目名稱:http4e,代碼行數:10,代碼來源:ResponseView.java

示例3: buildJsonEditorText

import org.eclipse.jface.text.source.SourceViewer; //導入方法依賴的package包/類
private StyledText buildJsonEditorText( Composite parent){
   final SourceViewer sourceViewer = new SourceViewer(parent, null, SWT.MULTI | SWT.V_SCROLL | SWT.WRAP);
   StyledText st = sourceViewer.getTextWidget();
   JSONLineStyler jsonStyler = new JSONLineStyler();
   st.addLineStyleListener(jsonStyler);
   return st;
}
 
開發者ID:nextinterfaces,項目名稱:http4e,代碼行數:8,代碼來源:ResponseView.java

示例4: buildEditorText

import org.eclipse.jface.text.source.SourceViewer; //導入方法依賴的package包/類
private static StyledText buildEditorText( Composite parent){
   final SourceViewer sourceViewer = new SourceViewer(parent, null, SWT.MULTI | SWT.V_SCROLL | SWT.WRAP);

   final XMLConfiguration sourceConf = new XMLConfiguration(new ColorManagerAdaptor(ResourceUtils.getResourceCache()));
   sourceViewer.configure(sourceConf);
   sourceViewer.setDocument(DocumentUtils.createDocument2());

   return sourceViewer.getTextWidget();
}
 
開發者ID:nextinterfaces,項目名稱:http4e,代碼行數:10,代碼來源:SWTHelloWorld.java

示例5: createOutputViewer

import org.eclipse.jface.text.source.SourceViewer; //導入方法依賴的package包/類
/**
 * Creates the source viewer
 * @param parent
 * @param flags
 * @return
 */
public static SourceViewer createOutputViewer(Composite parent, int flags)
{
    SourceViewer sourceViewer = new SourceViewer(parent, null, null, false, flags);
    SourceViewerConfiguration configuration = new SourceViewerConfiguration();
    sourceViewer.configure(configuration);
    sourceViewer.setTabsToSpacesConverter(getTabToSpacesConverter());

    StyledText control = sourceViewer.getTextWidget();
    control.setFont(TLCUIActivator.getDefault().getOutputFont());
    control.setEditable(false);
    return sourceViewer;
}
 
開發者ID:tlaplus,項目名稱:tlaplus,代碼行數:19,代碼來源:FormHelper.java

示例6: createSourceViewer

import org.eclipse.jface.text.source.SourceViewer; //導入方法依賴的package包/類
/**
 * Creates the source viewer
 * @param parent
 * @param flags
 * @return
 */
public static SourceViewer createSourceViewer(Composite parent, int flags)
{
    SourceViewer sourceViewer = new SourceViewer(parent, null, null, false, flags);
    SourceViewerConfiguration configuration = new SourceViewerConfiguration();
    sourceViewer.configure(configuration);
    sourceViewer.setTabsToSpacesConverter(getTabToSpacesConverter());

    StyledText control = sourceViewer.getTextWidget();
    control.setWordWrap(true);
    control.setFont(TLCUIActivator.getDefault().getCourierFont());
    control.setEditable(true);
    return sourceViewer;
}
 
開發者ID:tlaplus,項目名稱:tlaplus,代碼行數:20,代碼來源:FormHelper.java

示例7: getTextWidget

import org.eclipse.jface.text.source.SourceViewer; //導入方法依賴的package包/類
private StyledText getTextWidget() {
	SourceViewer viewer = getSourceViewer();
	if (viewer != null) {
		return viewer.getTextWidget();
	}
	return null;
}
 
開發者ID:cplutte,項目名稱:bts,代碼行數:8,代碼來源:AbstractSourceView.java

示例8: createPartControl

import org.eclipse.jface.text.source.SourceViewer; //導入方法依賴的package包/類
@Override
public void createPartControl(Composite parent) {
	SashForm sash = new SashForm(parent, SWT.VERTICAL | SWT.SMOOTH);
	queryViewer = new SourceViewer(sash, null, SWT.MULTI | SWT.WRAP);
	queryViewer.configure(new OptiqSourceViewerConfiguration());
	queryString = queryViewer.getTextWidget();
	queryString.setFont(JFaceResources.getFont(JFaceResources.TEXT_FONT));
	queryString.addKeyListener(new KeyAdapter() {
		@Override
		public void keyPressed(KeyEvent e) {
			if (e.keyCode == '\r' && (e.stateMask & SWT.MOD1) != 0) {
				e.doit = false;
				executeAction.run();
			} else if (e.keyCode == ' ' && (e.stateMask & SWT.CTRL) != 0) {
				// ctrl space combination for content assist
				// contentAssistAction.run();
			} else if (e.keyCode == SWT.F5) {
				executeAction.run();
				e.doit = false;
			}
		}

	});

	IDocument doc = createDocument();
	SourceViewerConfiguration svc = new OptiqSourceViewerConfiguration();
	IDocumentPartitioner partitioner = new FastPartitioner(
			new OptiqPartitionScanner(),
			svc.getConfiguredContentTypes(queryViewer));
	partitioner.connect(doc);
	doc.setDocumentPartitioner(partitioner);
	queryViewer.setDocument(doc);
	queryViewer.configure(svc);

	createContainer(sash);
	makeActions();

	installUndoRedoSupport();
}
 
開發者ID:vlsi,項目名稱:optiq-mat-plugin,代碼行數:40,代碼來源:OptiqPane.java

示例9: attachMenus

import org.eclipse.jface.text.source.SourceViewer; //導入方法依賴的package包/類
/**
 * 
 * @param viewer
 */
private final void attachMenus( SourceViewer viewer )
{
	StyledText widget = viewer.getTextWidget( );
	TextMenuManager menuManager = new TextMenuManager( viewer );
	widget.setMenu( menuManager.getContextMenu( widget ) );
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:11,代碼來源:SQLDataSetEditorPage.java

示例10: updateIndentationSettings

import org.eclipse.jface.text.source.SourceViewer; //導入方法依賴的package包/類
protected void updateIndentationSettings(SourceViewer sourceViewer, String property) {
	if(CodeFormatterConstants.FORMATTER_TAB_SIZE.key.equals(property)) {
		StyledText textWidget = sourceViewer.getTextWidget();
		int tabWidth = getTabWidth(sourceViewer);
		textWidget.setTabs(tabWidth);
	}
}
 
開發者ID:GoClipse,項目名稱:goclipse,代碼行數:8,代碼來源:AbstractSimpleLangSourceViewerConfiguration.java

示例11: createPartControl

import org.eclipse.jface.text.source.SourceViewer; //導入方法依賴的package包/類
/**
 * This is a callback that will allow us
 * to create the viewer and initialize it.
 */
public void createPartControl(Composite parent) {
	fShell = parent.getShell();
	
	Composite container = new Composite(parent, SWT.NONE);
	GridLayout gl = new GridLayout(1, true);
	gl.horizontalSpacing = 0;
	gl.verticalSpacing = 0;
	gl.marginHeight = 0;
	gl.marginWidth = 0;
	container.setLayout(gl);
	fMsg = new Label(container, SWT.NONE);
	fMsg.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false));
	msgColor = fMsg.getDisplay().getSystemColor(SWT.COLOR_BLACK);
	redColor = fMsg.getDisplay().getSystemColor(SWT.COLOR_RED);
	
	fDoc = new Document();
	edFileList = new SourceViewer(container, null, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL);
	edFileList.setDocument(fDoc);
	edFileList.configure(new SourceViewerConfiguration());//for undoManager & other... 
	edFileList.getTextWidget().setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
	edFileList.getTextWidget().setFont(JFaceResources.getTextFont());
	DropTarget target = new DropTarget(edFileList.getTextWidget(),DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_DEFAULT);
	target.setTransfer(new Transfer[]{ResourceTransfer.getInstance()});
	target.addDropListener(new DropListender(target.getTransfer()[0]));
	new SourceViewerKeyHandler().install(edFileList);
	
	fAT = new IAccessText() {
		public void setText(String newTxt) {
			setTextFromBG(newTxt);
		}
		public String getText() {
			return _getText();
		}
		public void showMessage(int msgType, String s) {
			showMessageFromBG(msgType, s);
		}
		public Shell getShell() {
			return _getShell();
		}
	};
	
	boolean newBlockSelection = true;
	try {
		edFileList.getTextWidget().getBlockSelection();
	} catch (Throwable e) {
		newBlockSelection = false;
	}
	makeActions(newBlockSelection);
	
	IActionBars bars = getViewSite().getActionBars();
	fillLocalPullDown(bars.getMenuManager());
	fillLocalToolBar(bars.getToolBarManager());
}
 
開發者ID:BeckYang,項目名稱:TeamFileList,代碼行數:58,代碼來源:TeamFileListView.java


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