Java Code Examples for org.eclipse.jface.bindings.keys.ParseException#printStackTrace()

The following examples show how to use org.eclipse.jface.bindings.keys.ParseException#printStackTrace() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CommandDataDialog.java    From EasyShell with Eclipse Public License 2.0 6 votes vote down vote up
private ContentProposalAdapter addContentAssistSimple(Text textControl) {
    char[] autoActivationCharacters = new char[] { '$', '{' };
    KeyStroke keyStroke = null;
    try {
        keyStroke = KeyStroke.getInstance("Ctrl+Space");
    } catch (ParseException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    // assume that myTextControl has already been created in some way
    List<Variable> variables = Variable.getVisibleVariables();
    String[] proposals = new String [variables.size()];
    for(int i=0;i<variables.size();i++) {
        proposals[i] = variables.get(i).getFullVariableName();
    }
    ContentProposalAdapter adapter = new ContentProposalAdapter(
            textControl , new TextContentAdapter(),
        new SimpleContentProposalProvider(proposals),
        keyStroke, autoActivationCharacters);
    adapter.setPropagateKeys(false);
    adapter.setFilterStyle(ContentProposalAdapter.FILTER_NONE);
    //adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
    return adapter;
}
 
Example 2
Source File: DBManagement.java    From translationstudio8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param from
 *            入口,请使用 TSUIConstants 类中提供的枚举。
 * @return 打开的库管理对话框;
 */
public DatabaseManagementDialog openDBMgmgDialog(Entry from) {
	if (from.equals(TsUIConstants.Entry.MENU)) {
		ts.menuDBManagement().click();
	} else if (from.equals(TsUIConstants.Entry.SHORTCUT)) {
		try {
			ts.pressShortcut(SWTBotUtils.getCtrlOrCmdKey(), Keystrokes.SHIFT, KeyStroke.getInstance("D"));
		} catch (ParseException e) {
			e.printStackTrace();
			assertTrue("快捷键解析错误。", false);
		}
	} else {
		assertTrue("参数错误,该功能无此入口:" + from, false);
	}
	dialog = new DatabaseManagementDialog(DatabaseManagementDialog.MANAGEMENT);
	return dialog;
}
 
Example 3
Source File: MemoryDBManagement.java    From translationstudio8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param from
 *            入口,请使用 TSUIConstants 类中提供的枚举。
 * @return 打开的库管理对话框;
 */
public MemoryDatabaseManagementDialog openDBMgmgDialog(Entry from) {
	if (from.equals(TsUIConstants.Entry.MENU)) {
		if (isMemory){
			ts.menuDBManagement().click();
		} else {
			ts.menuTeriDBManagement().click();
		}
	} else if (from.equals(TsUIConstants.Entry.SHORTCUT)) {
		try {
			ts.pressShortcut(SWTBotUtils.getCtrlOrCmdKey(), Keystrokes.SHIFT, KeyStroke.getInstance("D"));
		} catch (ParseException e) {
			e.printStackTrace();
			assertTrue("快捷键解析错误。", false);
		}
	} else {
		assertTrue("参数错误,该功能无此入口:" + from, false);
	}
	dialog = new MemoryDatabaseManagementDialog(MemoryDatabaseManagementDialog.MANAGEMENT,isMemory?"dlgTitleMemoryManagement":"dlgTitletreiTbManagement");
	return dialog;
}
 
Example 4
Source File: DBManagement.java    From tmxeditor8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param from
 *            入口,请使用 TSUIConstants 类中提供的枚举。
 * @return 打开的库管理对话框;
 */
public DatabaseManagementDialog openDBMgmgDialog(Entry from) {
	if (from.equals(TsUIConstants.Entry.MENU)) {
		ts.menuDBManagement().click();
	} else if (from.equals(TsUIConstants.Entry.SHORTCUT)) {
		try {
			ts.pressShortcut(SWTBotUtils.getCtrlOrCmdKey(), Keystrokes.SHIFT, KeyStroke.getInstance("D"));
		} catch (ParseException e) {
			e.printStackTrace();
			assertTrue("快捷键解析错误。", false);
		}
	} else {
		assertTrue("参数错误,该功能无此入口:" + from, false);
	}
	dialog = new DatabaseManagementDialog(DatabaseManagementDialog.MANAGEMENT);
	return dialog;
}
 
Example 5
Source File: MemoryDBManagement.java    From tmxeditor8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param from
 *            入口,请使用 TSUIConstants 类中提供的枚举。
 * @return 打开的库管理对话框;
 */
public MemoryDatabaseManagementDialog openDBMgmgDialog(Entry from) {
	if (from.equals(TsUIConstants.Entry.MENU)) {
		if (isMemory){
			ts.menuDBManagement().click();
		} else {
			ts.menuTeriDBManagement().click();
		}
	} else if (from.equals(TsUIConstants.Entry.SHORTCUT)) {
		try {
			ts.pressShortcut(SWTBotUtils.getCtrlOrCmdKey(), Keystrokes.SHIFT, KeyStroke.getInstance("D"));
		} catch (ParseException e) {
			e.printStackTrace();
			assertTrue("快捷键解析错误。", false);
		}
	} else {
		assertTrue("参数错误,该功能无此入口:" + from, false);
	}
	dialog = new MemoryDatabaseManagementDialog(MemoryDatabaseManagementDialog.MANAGEMENT,isMemory?"dlgTitleMemoryManagement":"dlgTitletreiTbManagement");
	return dialog;
}
 
Example 6
Source File: NpmInstallWidget.java    From typescript.java with MIT License 5 votes vote down vote up
private void addContentProposal(Text text) {
	char[] autoActivationCharacters = null;// new char[] { '.' };
	KeyStroke keyStroke = null;
	try {
		keyStroke = KeyStroke.getInstance("Ctrl+Space");
	} catch (ParseException e) {
		e.printStackTrace();
	}
	adapter = new VersionContentProposalAdapter(text, new TextContentAdapter(),
			new VersionContentProposalProvider(), keyStroke, autoActivationCharacters);
	adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
	adapter.setPropagateKeys(true);
	adapter.setLabelProvider(VersionLabelProvider.getInstance());

}