使用MessageDialog报错的问题处理

本文介绍了解决使用org.eclipse.jface.dialogs.MessageDialog;包的MessageDialog.openInformation(shell,title,message)方法时遇到的Exceptioninthreadmainjava.lang.NoClassDefFoundError:org/eclipse/core/runtime/IStatus错误的方法。通过添加org.eclipse.core.commands_3.2.0.I20060605-1400.jar和org.eclipse.equinox.common_3.2.0.v20060603.jar这两个必要的jar文件可以解决该问题。
使用org.eclipse.jface.dialogs.MessageDialog;包的MessageDialog.openInformation(shell,title,message)方法时报错Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/core/runtime/IStatus。其实这个错误是由于import的包不全导致的。在添加了org.eclipse.core.commands_3.2.0.I20060605-1400.jar和org.eclipse.equinox.common_3.2.0.v20060603.jar后该问题解决。这个异常是由于调用事件处理器EventManager,而需要使用到上述两个包。
<template> <MessageDialog ref="orgTreeDialog" width="500px" height="500px" :title="props.title"> <template #message> <div style="margin: 10px"> <div style="background-color: #ffffff"> <div style="margin-bottom: 10px" class="space-between"> <el-input v-model="searchInput" placeholder="输入搜索内容" style="width: calc(100% - 10px - 60px); margin-right: 10px"> <template #prefix> <el-icon><Search @click="searchTree()" /></el-icon> </template> </el-input> <el-button class="search-btn" @click="searchTree()" >搜索</el-button > </div> <div class="tree-content"> <el-tree class="chose-tree" ref="treeRef" :expand-on-click-node="false" :check-strictly="true" show-checkbox :node-key="treeProps['id']" style="height: 400px; overflow-y: scroll" :data="treeData" :props="treeProps" default-expand-all :filter-node-method="filterNode"> </el-tree> </div> </div> </div> </template> <template #foot> <el-button type="primary" @click="handleSelectUser()" >确认选择 </el-button> </template> </MessageDialog> </template> <script setup> import { ref, onMounted, nextTick } from 'vue' import MessageDialog from '@/components/MessageDialog.vue' import { TreeUtils } from '@/utils/utils.js' import { Search } from '@element-plus/icons-vue' import { ElMessage } from 'element-plus' import SecondConfirmDialog from '@/components/SecondConfirmDialog.vue' import http from '@/service/index' const props = defineProps({ title: { type: String, default: '选择', }, type: { type: String, default: 'multiple', }, }) const emits = defineEmits(['confirmEmit']) const orgTreeDialog = ref() const searchInput = ref() const selectedData = ref([]) const treeRef = ref() const searchTree = () => { if (treeRef.value) treeRef.value = treeRef.value.filter(searchInput.value) } //选择树功能 const filterNode = (value, data) => { if (!value) { return true } return data[treeProps.label].includes(value) } const handleSelectUser = () => {} const currentItem = ref({}) const hasCheckedData = ref([]) const treeData = ref([]) const treeProps = ref({}) const type = ref('none') const open = async (type = 'none', data = [], checkedList = [], props = { label: 'label', id: 'id', children: 'children', disabled: 'disabled' }) => { type.value = type treeData.value = data treeProps.value = props checkedData.value = checkedList orgTreeDialog.value.openDialog() await nextTick() } defineExpose({ open, }) </script> <style scoped> @import url('@/assets/css/public.css'); .tree-content { border: 1px solid rgba(242, 242, 242, 1); .tree-header { font-size: calc(var(--system-font-size) + 1px); font-weight: bold; color: #555555; border-bottom: 1px solid rgba(242, 242, 242, 1); } .el-tree { height: 340px; overflow-y: auto; } } :deep(.el-tree-node.is-checked) { color: #2c74c8; } :deep(.el-tree-node__content) { height: 32px; } .tree_info { font-size: 13px; color: #555555; font-weight: bold; border: 1px solid #f2f2f2; height: 32px; line-height: 32px; } </style> 这代码哪里有问题,为什么一直冒红
12-13
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值