首页 \ 问答 \ 如何从我的自定义Eclipse插件调用现有的Eclipse对话框?(How to call an existing Eclipse dialog from my custom Eclipse plugin?)

如何从我的自定义Eclipse插件调用现有的Eclipse对话框?(How to call an existing Eclipse dialog from my custom Eclipse plugin?)

我正在创建一个Eclipse插件,需要调用Eclipse Refactor - Move对话框并动态传递源文件目标位置值。 由于我已经拥有了源文件和目标位置,因此我可以跳过“选择目标”页面并直接转到“预览”页面,用户将在该页面中查看由移动引起的变形代码。

我的问题是,如何从插件中调用现有的Eclipse对话框? 我应该使用哪些扩展点?


I'm creating an Eclipse plugin that need to invoke the Eclipse Refactor - Move dialog box and pass the source file and destination location values dynamically. Since I already have the source file and destination location, I can skip the "Choose destination" page and directly go to the "Preview" page where the user will review the rafactored code caused by the move.

My questions is, how can I call the existing Eclipse dialog from my plugin? What are the extension points should I use?


原文:https://stackoverflow.com/questions/11959521
更新时间:2022-02-24 11:02

最满意答案

$response['errors'] = $validator->errors()->all();

return response()->json($response, 400);

浏览器需要知道错误状态才能在该ajax函数中触发error方法。 请参阅https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#4xx_Client_Error

 $.ajax({
        url: url,
        type: 'POST',
        data: $writeForm.serialize(),
        error: function(res){ //by using this method, you're assuming that all the logic here is for error handling.
                console.log(res.status, res.errors);
        }

    });

$response['errors'] = $validator->errors()->all();

return response()->json($response, 400);

The browser needs to know the error status in order to trigger your error method in that ajax function. See https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#4xx_Client_Error

 $.ajax({
        url: url,
        type: 'POST',
        data: $writeForm.serialize(),
        error: function(res){ //by using this method, you're assuming that all the logic here is for error handling.
                console.log(res.status, res.errors);
        }

    });

相关问答

更多
  • 你可以像这样使用它: $request->validate($rules); 要么 $request->validate([ 'name' => 'required|min:2|max:255' ]); 然后它返回错误。 $test = $request->validate([ 'name' => 'required|min:2|max:255' ]); 你需要检查是否没有错误,然后你可以做你想做的事情。 在你的情况下,你需要这样做: $validator ...
  • 您似乎还需要以下标题: "X-Requested-With: XMLHttpRequest" 从而: curl -X POST -H "Content-Type: application/json" -H "X-Requested-With: XMLHttpRequest" -H "Cache-Control: no-cache" -d '{}' "http://yours.com/user/register" 现在$this->validate(...)正确返回JSON响应。 You also s ...
  • 删除你的代码,你可以试试这个代码: public function submit(Request $request) { $error = false; $result = array(); $responsecode = 200; $validator = Validator::make($request, [ 'user_firstname' => 'required|string|max:255', 'user_lastnam ...
  • 像这样尝试 error: function (xhr) { $('#validation-errors').html(''); $.each(xhr.responseJSON.errors, function(key,value) { $('#validation-errors').append('
    '+value+'
  • 这是验证错误。 该信息将返回到$errors变量。 您可以按照您想要的任何方式处理,但我想最明显的操作是向用户显示错误。 实际上最好有一个422而不是200(一切都好,因为它不是)。 由于auth系统依赖于验证请求,因此您不希望控制器继续(例如,通过保存未通过验证的数据)。 This is a validation error. The information is returned to the $errors variable. You can handle that any way you want ...
  • 这是一个预期的行为,你不能通过XMLHTTPRequest发送上传文件,这就是为什么你总是会收到图像文件是必需的验证。 你可以使用ajaxfileuploader插件(他们在iframe中创建一个新表单并提交它) [ http://www.sitepoint.com/10-jquery-ajax-file-uploader-plugins/] this is an intended behavior, you cant send upload file over XMLHTTPRequest, that i ...
  • $response['errors'] = $validator->errors()->all(); return response()->json($response, 400); 浏览器需要知道错误状态才能在该ajax函数中触发error方法。 请参阅https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#4xx_Client_Error $.ajax({ url: url, type: 'POST', ...
  • 您的声明文档说最好在控制器中验证AJAX请求是完全错误的。 如果您从链接的内容进一步向下滚动 - 您将在FormValidation部分下看到这一点 如果验证失败,将生成重定向响应以将用户发送回其先前的位置。 错误也将闪现到会话中,以便可以显示。 如果请求是AJAX请求,则将向用户返回具有422状态代码的HTTP响应,包括验证错误的JSON表示。 换句话说 - 没有理由你不能在一个简单的FormRequest中做到这一点,只是你的代码显着。 它将自动处理它是一个AJAX调用的事实并返回适当的HTTP响应。 ...
  • 如果您的验证失败,它将返回状态代码(错误代码) 422 。 在$.ajax您只使用success ,如果验证失败则不会被调用。 您需要为ajax选项添加错误方法。 使用上面的代码,你会得到类似的东西: success: function (data) { $('.error').remove() $('table').append("" + data.id + "" + data.nom + "< ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)